The whole concept of exception handling gives me headaches. Currently, what I want to do is to handle certain exceptions, which I'm sure I can handle. On the other hand, I want to terminate the application if an exception is thrown that I do not know how to handle. When I put try-catch blocks in my source code, it looks ugly because there are a lot of them. Is there a global exception handling mechanism, for example, an event that is fired after an unhandled exception is dispatched? Thus, I can display an error message for the user and terminate the application, rather than repeating this process again and again throughout the entire source code.
PS I want to terminate the application in such a scenario, because I am afraid that the program may start to work incorrectly after an unhandled exception is sent.
source
share