When an exception occurs, it is desirable that your application caters for it in a professional manner. That is the application shouldn’t just disappear and provide no clues to the user what has gone wrong. I covered how you can handle this in an earlier Ask Reuben article. There are a class of errors where this is not always possible and these are called non-trappable errors.
Read more at
https://4js.com/ask-reuben/ig-95/