Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Uncaught Exception Handling
This is a duplicate question / thread, however the previous posts are now dated. I am wondering have there been any developments pertaining to best practices for this.
What is the best way to define / set a handler for uncaught exceptions:
At main UI?:
UI.getCurrent().setErrorHandler(new CustomErrorHandler());
Or on session level?:
VaadinSession.getCurrent().setErrorHandler(new CustomErrorHandler());
What are the benefits of each? Should one register a handler with both the Session & UI in an init() method?
Related posts include:
https://vaadin.com/docs/-/part/framework/application/application-errors.html
https://vaadin.com/forum/#!/thread/1383731/1383730
http://stackoverflow.com/questions/20615816/central-error-handling-in-vaadin
Thanks so much taking the time to read this and help.