Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Server-side ASP.Net Ajax exception handling

I am using ASP.net's AJAX framework and I am trying to do some exception logging on the javascript-called webservice.

Looking through the web, I find some people handling them client-side and sending them back to the server. I'd prefer not doing that since it relies on an other server call (if it failed the first time, sending an other request doesn't look like a good idea and that makes me change all my calls)

I see some other people decorating all their methods with try... catch blocks (which leads to duplicate error handling, and yet an other try catch block).

However, I'm trying to achieve something similar to global.asax's Application_Error() which handles every uncaught exception (nope, it doesn't seem to be called for AJAX called methods exceptions).

Is that even possible?

like image 752
Luk Avatar asked Apr 24 '09 12:04

Luk


1 Answers

Use ELMAH - it can capture ajax errors.

like image 182
Rashack Avatar answered Sep 17 '22 23:09

Rashack