Java + GWT client-side exception handling

I use GWT to develop my web application and would like to know how I can efficiently handle client-side exceptions, so that page ranking will not break due to an exception at the beginning of the page rendering. I can try and catch the blocks in my code. But can someone help me with this so that I can handle runtime exceptions and show the web page to the user, even if there is some error in the code. It would also be nice if I could log exceptions and errors that occur on the client side.

Thanks!!

+4
source share
1 answer

I would look at GWT.setUncaughtExceptionHandler - this will allow you to catch exceptions and show the user an error message if something goes wrong, you were not taken into account in the try / catch block.

Obviously, if there is something that may go wrong as you might expect, it is better to catch it and display the corresponding message, but this works for common errors.

+5
source

Source: https://habr.com/ru/post/1346686/


All Articles