title: What is the best way to return error message from function?
body: <p>If face a logic error error such <code>(Expired user, invalid ID)</code>, then what is the best way to tell the parent method of this error from the following :</p>
  
  <p>1- Throwing customized exception like the following :</p>
  
  <pre><code> try
  {
  //if (ID doesn't match) then 
  Throw new CustomException(-1,"ID doesn't match");
  }
  catch(CustomException ex)
  {
  throw ex
  }
  catch(Exception ex)
  {
  throw new CustomException(ex.ErrorCode,ex.message);
  }
  </code></pre>
  
  <p>2- return error message and code like : </p>
  
  <pre><code>//if (ID doesn't match) then 
  This.ErrorCode= -1;
  This.Message= "ID doesn't match";
  </code></pre>