Tell me please. How to make a global interception of errors occurring on the server side when ajax request for a servlet. By global, I mean one mechanism, be it a class or a function that intercepts Exception arising in .class files before an answer. Now it works in such a way that I get all the error information in response - this is the status (code - 500, 400, etc.), the message (for example, java.lang.NumberFormatException: null ) and the so-called StackTrace (error details - indication of classes, etc.). I only need to reply with the status and message and display it to the user. How to do it?
I use Servlet API