I ask this question because soon I'll have interview heavily focused on error handling but also this is something I haven't figure out even though I have almost 7 months as a junior C# developer.
As the title says I want to know what is the right way to deal with exceptions form which there is no appropriate error handler. Some time ago I've heard a colleague of mine talking about generic exception handler (whatever that may mean) which is responsible to deal with suck case scenarios. However I did I little googling I haven't been able to find some information about such a thing.
So my question is - how to deal with those kind of exceptions and my subquestion is - is there really something called generic exception handler?
is there really something called generic exception handler?
Yes - that's what they call the handler that logs the exception and stores as much info as possible before quitting the program. One way to set up a handler like that is adding a handler to the UnhandledException
event of your AppDomain
object.
It is neither "generic" nor a "handler" in the .NET sense, because no generic types are involved, and because the actions the handler could take are rather limited. Unlike a real handler which could block or re-throw the exceptions that it handles, the last-chance "handler" could see what's been thrown, but cannot cause the execution to continue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With