Recently I recently joined the asp.net mvc project, where there is not much consistency with eliminating exceptions in the controller; some developers return data to the client so that the user knows what is wrong, others throw it back so that they reach the server-level handler that processes and registers it, not letting the user know what is happening.
It seems obvious to me that both approaches are wrong on their own and need to be complemented by each other; I'm stuck on how to do this. I assume that the final exception handler / logger may redirect the user to the webpage with an error if something particularly unpleasant is caught, but this limits the mechanism to only serious things.
I’m kind of looking for a way to make a “throw” and “return ...” while I catch the exception, so I get it sorting and registering on the server side and getting the client side of the data, which allows me to tell the user that there is hiccups .
My experience with asp.net is very limited, and although I believe that I understand that mvc is enough to not be a problem, it’s kind of “what is the best practice?”. the question is from someone who works with people who are not worried about best practices.
Mir
source share