Is there any way of defining a server side global exception handler for PageMethods or ScriptService Web Methods? This is for logging - will pass through the error to the client. Tried a SoapExtension, before I realised that SOAP isn't used! Global.asax
Application_OnError is not hit?
Seriously - is there no way of doing this? Can't find anything online.
Wasted a lot of time on this. Gonna have to do try catch blocks on each method for the moment, but that's seriously rubbish!
Thanks. I've seen that. ELMAH - I don't think I'll be allowed to include yet another 3rd party product into the software. Is there any other alternative?
JimLad1
Member
20 Points
53 Posts
Logging unhandled exceptions server side in PageMethods or ScriptService web methods.
Feb 12, 2012 11:33 PM|LINK
Hi,
ASP.NET 3.5
Is there any way of defining a server side global exception handler for PageMethods or ScriptService Web Methods? This is for logging - will pass through the error to the client. Tried a SoapExtension, before I realised that SOAP isn't used! Global.asax Application_OnError is not hit?
Seriously - is there no way of doing this? Can't find anything online.
Wasted a lot of time on this. Gonna have to do try catch blocks on each method for the moment, but that's seriously rubbish!
Cheers,
James
tehremo
Star
10540 Points
1704 Posts
Re: Logging unhandled exceptions server side in PageMethods or ScriptService web methods.
Feb 13, 2012 12:16 AM|LINK
You should be using Application_Error, not Application_OnError:
http://msdn.microsoft.com/en-us/library/fwzzh56s%28v=vs.100%29.aspx
JimLad1
Member
20 Points
53 Posts
Re: Logging unhandled exceptions server side in PageMethods or ScriptService web methods.
Feb 13, 2012 04:24 PM|LINK
Thanks for the reply. I am using Application_Error - that was a typo. It doesn't work for web methods. Question still open.
chetan.sarod...
All-Star
65749 Points
11148 Posts
Re: Logging unhandled exceptions server side in PageMethods or ScriptService web methods.
Feb 14, 2012 02:40 AM|LINK
http://stackoverflow.com/questions/785585/server-side-asp-net-ajax-exception-handling
http://forums.asp.net/t/1714921.aspx/1
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
JimLad1
Member
20 Points
53 Posts
Re: Logging unhandled exceptions server side in PageMethods or ScriptService web methods.
Feb 15, 2012 12:53 PM|LINK
Thanks. I've seen that. ELMAH - I don't think I'll be allowed to include yet another 3rd party product into the software. Is there any other alternative?
Cheers,
James