Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hooks for customizing behavior on system errors #4534

Open
brp-benjamin opened this issue Aug 16, 2018 · 5 comments
Open

Hooks for customizing behavior on system errors #4534

brp-benjamin opened this issue Aug 16, 2018 · 5 comments

Comments

@brp-benjamin
Copy link

If there is an exception thrown by a custom component the system will treat that as an unrecoverable error and it will be handled internally by the SystemErrorHandler class. The SystemErrorHandler will create a client side element which informs the end user that they need to refresh the ui.

We wish to customize this element as well as add server side logic that logs unrecoverable errors to our helpdesk system. However as far as I can see there is no ability to hook into the SystemErrorHandler.

@Artur-
Copy link
Member

Artur- commented Aug 16, 2018

Is this the same as #801 which causes exceptions to go to ErrorHandler in VaadinSession instead of always causing an "Internal Error"? This you can customize using VaadinSession.setErrorHandler

@brp-benjamin
Copy link
Author

I'm not sure I understand your comment. SystemErrorHandler is a different from ErrorHandler, while we can set a custom ErrorHandler for logging etc this does not allow us to control the SystemErrorHandler and the element that SystemErrorHandler creates in the browser.

@Artur-
Copy link
Member

Artur- commented Aug 16, 2018

Depends on if you are talking about a client or a server side exception.

For server side exceptions, they would be routed to the same SystemErrorHandler where you can add UI components, show a notification or do whatever you want. Currently the framework always sends these as "internal errors" to the client side, where they then end up in SystemErrorHandler without any information about what actually went wrong.

For client side exceptions you would need something else, on the client side.

@Artur-
Copy link
Member

Artur- commented Aug 16, 2018

It is possible to replace SystemErrorHandler with your own implementation but that involves extending and recompiling flow-client. Not sure if that is even documented anywhere

@estronque
Copy link

Is there any other mechanism to prevent the div from being displayed even if I am in development mode?

Analyzing the code of version 2.7.13 I see that if "registry.getApplicationConfiguration().isProductionMode()" is true the div is not displayed.

I understand that creating a 'custom flow client' maven project could make the project unstable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants