Reputation: 1863
I am using WCF and Sync Framework to synchronize data between SQL 2008 and SQL Ce 3.5. I would like to only send well formed custom faults back to the client should something go wrong on the server. However, the issue I am running into is when one of the Sync Framework methods is the source of the error, my fault is wrapped in a generic "Exception thrown by target of invocation" and returns to the client with the custom fault as the inner exception. As such, the client must catch the error as a generic Exception and then handle the inner exception.
How can I strip off the wrapper exception and just show the real error to the consumer of my service?
Upvotes: 0
Views: 289
Reputation: 633
Hook up a custom IErrorHandler to do the exception translation.
Upvotes: 2