Michael Kingsmill
Michael Kingsmill

Reputation: 1863

Sync Framework exception handling as WCF faults

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

Answers (1)

Rory Primrose
Rory Primrose

Reputation: 633

Hook up a custom IErrorHandler to do the exception translation.

Upvotes: 2

Related Questions