title: How to return error from async funtion returning Task<T>
body: <p>I have a basic asynchronous method in one class, which returns an object.</p>
  
  <p>In some of the flows it may fail and I want to report it back.</p>
  
  <p>But I can only return the object.</p>
  
  <p>I tried nullable object, but got the error:</p>
  
  <blockquote>
    <p>MyObject must be a non-nullable value type in order to use it as parameter 'T' in the generic type or method 'System.Nullable'</p>
  </blockquote>
  
  <p>I assume I can use exception, but I wanted something simpler in the calling function.</p>
  
  <p>I also cannot use <code>ref</code> or <code>out</code> in async methods.</p>
  
  <p>Is there a way to report back some kind of true/false of success or failure?</p>
  
  <pre><code>public static async Task&lt;MyObject&gt; getObject()
  {
      if (NotOkFromSomeReason())
      {
            //Not sure what to do here
      }
      return await myDataBase.FindAsync(something);
  }
  </code></pre>
  
  <p>I call it using:</p>
  
  <pre><code>  MyObject object = await getObject();
    // I want something simple as if(object)...
  </code></pre>