I am using the GWT for developing my web application and would like to know how can i handle the exceptions efficiently at the client side so the rendenring of pages wont break because of the exception at the start of the rendering of page.
I can have try and catch blocks in my code. But can some one guide me through this so that i can handle the runtime exceptions and show the web page to the user even if the there is some error in the code.
It would also be good if I can log the exceptions and errors that occur at the client side.
Thanks!!
I would look into GWT.setUncaughtExceptionHandler – this will allow you to catch exceptions and show an error message to the user if something goes wrong which you haven’t accounted for in a try/catch block.
Obviously if there’s something that can go wrong which you can anticipate it’s better to catch it and display an appropriate message, but this works for generic errors.