title: Exception handling in ASP.NET (C#) web services
body: <p>I was looking for a way to transfer the exception message in web services of my asp.net application to the ajax error callback function.
  All I could find was catching an exception thrown from web service into a C# code but i am calling my service from ajax code and not a C# code. I want something more than the HTTP status codes returned.<br>
  Here is catch block of my Service code:</p>
  
  <pre><code>catch (Exception ex)
          {
              var fault = new GenericFault { Message = ex.Message, Operation = "" };
              throw new FaultException&lt;GenericFault&gt;(fault);
          }
      }
  </code></pre>
  
  <p>And here is my ajax error callback:</p>
  
  <pre><code> error: function (err) {
           alert("The server encountered an error, please resubmit your request. If the problem persists, contact your administrator.");
           return 'error occured';
      }
  </code></pre>
  
  <p>I have already tried throwing web fault exception but that also didn't serve the purpose as only the HTTP status code gets passed.</p>