how I can catch ALL exceptions


Is there any possibility to catch exceptions not cached by anyone. For example, if I do not want to put try-cacth-blocks to every listener of buttons. I want to avoid a situation that user sees the whole stacktrace.

Thanks beforehand!



If I understood correctly you do not want the user to see ‘component-errors’, which are those small icons appearing next to a component where the error occured.

If you would like to customize the error handling in your application you can override the terminalError-method in your application class (that extends Application). Some code:

    public void terminalError(Terminal.ErrorEvent event) {
       // Get the exception
       Throwable throwable = event.getThrowable();

       // Log exception

       // Tell the user that internal error has occured
       Label label = new Label("Internal error!!");

       // Show the label...


Hope this helps.


If I remember correctly there is a exception handler callback in Application class that could be utilized here.