title: WCF Rest .NET 4.0 Unhandled Exceptions
body: <p>I've found a bunch of questions that were very close to what I need. But I'm worried that I have missed some important information.</p>
  
  <p>How do I catch all unhandled exceptions using WCF Rest with .NET 4.0?</p>
  
  <p>For security purposes I do not want unhandled exceptions going to the client. I want to log all exceptions and for unknown exceptions just send back 500 Internal Server Error.</p>
  
  <p>My best research so far tells me I need to implement IErrorHandler and throw WebFaultExceptions for known exceptions. One issue I have with this is that all of my business logic is in a separate project from the WCF service and it doesn't make sense to throw a Web exception from the underlying class library since the class library could be consumed by another process which may not be a WCF Rest Service. Is there a nice way to map exceptions?</p>