Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In WCF - In the "Faulted" Event - How Do I Get The Exception Details?

Tags:

exception

wcf

I have a WCF server and I'm tapping into the "Faulted" event which stupidly only gives me "object sender, EventArgs e". How can I get the current 'Exception' object in that event?

Or, if there is some sort of global system way, like Environment.GetCurrentException(), that would be awesome, but I can't find it.

EDIT: To help explain what I'm hoping for... in ASP.NET, you can do "Server.GetLastError()"... Is there such a thing, or anthing even remotely close in WCF? - OperationContext.Current.GetLastError() would be cool :)

like image 239
Timothy Khouri Avatar asked Dec 19 '08 15:12

Timothy Khouri


1 Answers

OK, after some more googling with the right keywords, I've found my answer: http://www.steverb.com/post/Useful-WCF-Behaviors-IErrorHandler

like image 122
Timothy Khouri Avatar answered Nov 09 '22 09:11

Timothy Khouri