Question

I can't figure out why the exception from a static ASP.Net Page method isn't bubbling up to the Application_Error event to be handled in the global.asax file. I'm not really expecting any errors, but I would like to be safe and know about them if they do happen to occur and would rather not wrap every static method in a try...catch.

Does anyone know how to catch these exceptions or at least why they aren't bubbling?

Was it helpful?

Solution

Exceptions bubble to the error handler in Application_Error if they are not being handled in the lower layers. If you already have a TRY/CATCH block where you think the exception is occurring, it will be trapped at that point.

Please post the code of your static method and your Application_Error. It will make it easier to provide you with an accurate answer instead of a generalized one.

OTHER TIPS

If developing in Visual Studio, you should debug your code and then step through the source to find the exception and see what is catching it before bubbling up to your Application_Error method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top