tags:

views:

774

answers:

1

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 :)

+3  A: 

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

Timothy Khouri
Thanks for posting the answer
Yossi Dahan
I'm glad the article was helpful. If you have any questions or issues with implementing it let me know. And yes, I joined SO and accumulated rep points just so I could make this comment.
Stever B