I am writing a web service, which is a wrapper for a provider web service, and has a fairly detailed series of catch statements for calling provider web service methods. I have two or three types of exceptions that I handle (System.Web.Services.Protocols.SoapException, System.ApplicationException, System.Exception ...)
I just realized that most errors are the same between the two Create methods and their Update method.
Is there any smart way to split the same error handlers into multiple methods? I started writing only the usual method, but then I realized that I would have to write at least one common method for each type of exception that I am handling. It would be great if I could handle them the exact same way.
This is a web service with an installed interface. Just thinking out loud when I write this, I think I could put as little code as possible into web methods, and then they could name a common method? I just want to make sure that I'm not missing an obvious trick.
Thanks Neil
source
share