I have a wcf service which has many methods. Every method has a try catch block to catch exceptions like communication exception, timeout exception and any code specifc exception. I want a way to put this in a common place so that I dont have to repeat this
catch blocks in every method.
allfornet
Member
70 Points
17 Posts
Error handling in WCF
Feb 27, 2013 08:50 AM|LINK
I have a wcf service which has many methods. Every method has a try catch block to catch exceptions like communication exception, timeout exception and any code specifc exception. I want a way to put this in a common place so that I dont have to repeat this catch blocks in every method.
DarrellNorto...
All-Star
86809 Points
9646 Posts
Moderator
MVP
Re: Error handling in WCF
Feb 27, 2013 09:25 AM|LINK
You can configure and implement an IErrorHandler to do centralized error handling in WCF.
See this blog post for sample code: http://www.neovolve.com/post/2008/04/07/implementing-ierrorhandler.aspx
Darrell Norton's Blog
Please click "Mark as Answer" if this helped you.