I need to throw from wcf exceptions without showing a stacktrace to a client, just message...
throw new FaultException("ex1");
I have in average 20 exceptions strings. How do I implement it without throwing each time FaultException with string argument, but rather an exception object
FaultException_i i = 1...20
When using WCF service, you have to use FaulException because it's the native Soap approach for handling errors. However, not all exceptions implement wcf serialization correctly.
Exception details (including stacktrace) should never be exposed to clients. Your can easily turn off this in config :
In addition, I generaly use a custom data contract that will contain your exception information.
Then, I've just to throw a generic fault like this :