Global.asax and Processing Exceptions Occurring in Threads Generated

I have an exception handler. In my asp.net application. Its written in Global.asax. In the Application_Error () method.

It works for exceptions that occur in the context of pages and classes that are called as a result of a request to the application. But if I create a stream, as a result of the request (or for another reason, like an application-based timer) and Exceptions in this stream. It is not processed by Global.asax. This causes the Asp.nets workflow to kill my application. Dead. If I attach the AppDomain.CurrentDomain.UnhandledException handler, I see an exception that occurs in my thread, but, alas, it's too late. And the application is still dying. Dead. Any tips?

+3
source share
1 answer

exceptions in secondary threads are not reported by unhandled exception events

use SafeThread for your secondary threads

Caution: I am the author of the SafeThread article and the CALM product for monitoring applications

+3
source

Source: https://habr.com/ru/post/1698893/


All Articles