title: Why Enterprise Library does not throw FaultException in WCF
body: <p>I use WCF service hosted on IIS.<br>
  Also, I use fault contracts to send errors to the client (<strong>FaultException&lt;'T></strong>)<br>
  On the client side I catch <strong>FaultException&lt;'T></strong> to show some error to user.<br>
  If some unhandled exception being thrown on a server, WCF generates plain <strong>FaultException</strong>, 
  so client catches it and shows user "Internal Server Error" message.</p>
  
  <p>Then I began to use Enterprise Library 5.0 for WCF Exception Shielding, and met following issue. Using <em>FaultContractExceptionHandler</em> it is possible to carry all errors to the client, but in case of unhandled exception client receives <strong>CommunicationException</strong> instead of <strong>FaultException</strong>. Everything other works ok.</p>
  
  <p>If I turned off exception handling policy (remove ExceptionShielding attibute), client catches <strong>FaultExceptions</strong> as expected.<br>
  Do you know what may be the reason?<br>
  Thanks.</p>
  
  <p>PS: Here is a chain of inner exceptions:<br>
  CommunicationException -> WebException -> IOException -> SocketException<br>
  Message is "The underlying connection was closed: A connection that was expected to be kept alive was closed by the server."</p>
  
  <p><strong>Web.config</strong></p>
  
  <pre><code>&lt;add name="ServiceException Policy"&gt;
      &lt;exceptionTypes&gt;
        &lt;add name="ServiceLogicException" type="LopService.Contracts.ServiceLogicException, LopService.Contracts, Version=1.0.0.1725, Culture=neutral, PublicKeyToken=null"
          postHandlingAction="ThrowNewException"&gt;
          &lt;exceptionHandlers&gt;
            &lt;add type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF.FaultContractExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
              faultContractType="LopService.Contracts.ServiceLogicFaultContract, LopService.Contracts, Version=1.0.0.1725, Culture=neutral, PublicKeyToken=null"
              name="Fault Contract Exception Handler" /&gt;
          &lt;/exceptionHandlers&gt;
        &lt;/add&gt;
      &lt;/exceptionTypes&gt;
    &lt;/add&gt;
  </code></pre>
  
  <p><strong>Service Class</strong></p>
  
  <pre><code>[ExceptionShielding("ServiceException Policy")]
  public partial class LopSoapService
  {...
  </code></pre>
  
  <p><strong>Operation Contract</strong></p>
  
  <pre><code>    [OperationContract]
      [FaultContract(typeof(DataValidationFaultContract))]
      [FaultContract(typeof(ServiceLogicFaultContract))]
      int CreateUser(UserDto userDto, IEnumerable&lt;ClaimRecordDto&gt; claimRecords);
  </code></pre>