title: API Design: modify to return additional error information
body: <p>I have an API defined as follows</p>
  <p><code>bool IsValid()</code></p>
  <p>Now, I want to modify the API so that if the return value is false, then I need additional<br />
  information why the validation failed.<br />
  I'm looking for an elegant want to solve the problem... Here are the options I have</p>
  <p>Option 1:<br />
  <code>bool IsValid(ref string errorMessage)</code></p>
  <p>errorMessage is updated only if the result is false</p>
  <p>option 2:</p>
  <pre><code>class Result&lt;T&gt;
  {
     bool Succeeded;
     T Argument;
  }
  
  Result&lt;string&gt; IsValid()
  </code></pre>
  <p>Option 3:</p>
  <pre><code>void Validate();
  //throw an exception if it invalid, just return if succeeded.
  </code></pre>
  <p>I'm not comfortable with any of the options listed above. So, wondering if there is any graceful solution that I might not be aware of</p>