title: How to report error to $.ajax without throwing exception in MVC controller?
body: <p>I have a controller, and a method as defined...</p>
  
  <pre><code>[HttpPost]
  public ActionResult UpdateUser(UserInformation model){
  
     // Instead of throwing exception
     throw new InvalidOperationException("Something went wrong");
  
  
     // I need something like 
     return ExecutionError("Error Message");
  
     // which should be received as an error to my 
     // $.ajax at client side...
  
  }
  </code></pre>
  
  <p>Problems with Exceptions</p>
  
  <ol>
  <li>We have to log exceptions in case of device or network errors like SQL Connectivity errors. </li>
  <li>These messages are like validation messages for users, we dont want to log.</li>
  <li>Throwing exceptions also floods Event Viewer.</li>
  </ol>
  
  <p>I need some easy way to report some custom http status to my $.ajax call so that it should result an error at client side, but I do not want to throw an error.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I cannot change client script because it becomes inconsistent with other data source. </p>
  
  <p>So far, HttpStatusCodeResult should work but it's IIS that is causing the problem here. No matter what error message I set, tried all answers, still I receive default message only. </p>