I prefer to handle all unhandled exceptions (things that shouldn't happen) in the Application_Error method. Here you can register an exception and, based on its nature, show the correct idea of ββthe error.
Things like custom model bindings, validators, action filters, ... can also allow you to intercept some exceptional conditions so as not to damage your controllers with try / catch.
For everything that I intend to handle, for example, business errors, etc., there is nothing wrong with using try / catch or it is even better to use if and have a service level notifying you of TryXXX .)
So, as always, the answer to your question is: it depends. It depends on how your application is organized, how your service level is organized, what potential errors can occur, what errors you would like to explicitly handle ... many, many, many factors and, of course, many, many, many possible solutions.
source share