Arsen Mkrtchyan
Arsen Mkrtchyan

Reputation: 50752

How to catch exact exception in wcf service

I want to catch all Faults in WCF service, and found the way to do that

OperationContext.Current.Channel.Faulted += delegate(object sender, EventArgs args)
{
    //exception is thrwon in wcf service
}

the question is how to know the exact exception in Fault event?

Upvotes: 0

Views: 491

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039368

A better way would be to use an error handler by implementing the IErrorHandler interface.

Upvotes: 1

Related Questions