title: WCF Web Service Custom Exception Error to Client
body: <p>I would like to throw custom exception like some error message as an exception from WCF web service and trying receiver this exception error message in client app on calling web service method.</p>
  
  <p>how to throw custom exception from WCF web Service and receive same exception error at client side.</p>
  
  <p>WCF Web Service Method:</p>
  
  <pre><code>    public bool Read()
      {
          if (IsUserValid() == false)
          {
              throw new Exception("Authorized user");
          }
      }
  </code></pre>
  
  <p>At Client Side</p>
  
  <pre><code>try
  {
     _client.Read();
  }
  catch (Exception e)
  {
     MessageBox.Show(e.Message);
     return;
  }
  </code></pre>
  
  <p>Result: Always throw error message as an exception **i.e. </p>
  
  <blockquote>
    <p>"System.ServiceModel.FaultException:
    The server was unable to process the
    request due to an internal error.  For
    more information about the error,
    either turn on
    IncludeExceptionDetailInFaults (either
    from ServiceBehaviorAttribute or from
    the  configuration
    behavior) on the server in order to
    send the exception information back to
    the client, or turn on tracing as per
    the Microsoft .NET Framework 3.0 SDK
    documentation and inspect the server
    trace logs."</p>
  </blockquote>
  
  <p>This is code is throwing exception but not returning same error message as thrown from WCF web service as an exception error</p>
  
  <p>Please suggest</p>