What is the correct approach when the handler is not found in the call stack in a C # program

I ask this question because soon I will have an interview in which the main focus will be on error handling, but this is something that I did not understand, although I have almost 7 months as a junior C # developer.

As the title says, I want to know how to handle an exception form that does not have a corresponding error handler. Some time ago, I heard my colleague talk about a universal exception handler (whatever that means), which is responsible for sucking scripts. However, I did a little walk, and I could not find any information about this.

So my question is: how to deal with such exceptions and my subtext - is there something called a common exception handler?

+4
source share
3 answers

Is something really called a general exception handler?

Yes - this is what they call a handler that logs an exception and stores as much information as possible before exiting the program. One way to create such a handler is to add an event handler for UnhandledExceptionyour object AppDomain.

"", "" .NET, , , , . , , , "" , , .

+5

. AppDomain.UnhandeledException, , , e.t.c.

, , .

+1

, , , , - , , , . , , , ASP.NET, ( "" , ).

- . ( ).

A "general" exception handler will be catch (Exception ex). In other words, a trick. This is not an official term, but what a person had in mind.

+1
source

All Articles