Package com.vaadin.client
Class SystemErrorHandler
- java.lang.Object
-
- com.vaadin.client.SystemErrorHandler
-
public class SystemErrorHandler extends Object
Handles system errors in the application.- Since:
- 1.0
- Author:
- Vaadin Ltd
-
-
Constructor Summary
Constructors Constructor Description SystemErrorHandler(Registry registry)Creates a new instance connected to the given registry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandleError(String errorMessage)Shows the given error message if not running in production mode and logs it to the console if running in production mode.voidhandleError(Throwable throwable)Shows an error message if not running in production mode and logs it to the console if running in production mode.voidhandleSessionExpiredError(String details)Shows the session expiration notification.protected voidhandleUnrecoverableError(String details, ErrorMessage message)Shows an error notification for an error which is unrecoverable.voidhandleUnrecoverableError(String caption, String message, String details, String url)Shows an error notification for an error which is unrecoverable, using the given parameters.voidhandleUnrecoverableError(String caption, String message, String details, String url, String querySelector)Shows an error notification for an error which is unrecoverable, using the given parameters.
-
-
-
Constructor Detail
-
SystemErrorHandler
public SystemErrorHandler(Registry registry)
Creates a new instance connected to the given registry.- Parameters:
registry- the global registry
-
-
Method Detail
-
handleSessionExpiredError
public void handleSessionExpiredError(String details)
Shows the session expiration notification.- Parameters:
details- message details or null if there are no details
-
handleUnrecoverableError
protected void handleUnrecoverableError(String details, ErrorMessage message)
Shows an error notification for an error which is unrecoverable.- Parameters:
details- message details or null if there are no detailsmessage- an ErrorMessage describing the error
-
handleUnrecoverableError
public void handleUnrecoverableError(String caption, String message, String details, String url)
Shows an error notification for an error which is unrecoverable, using the given parameters.- Parameters:
caption- the caption of the messagemessage- the message bodydetails- message details ornullif there are no detailsurl- a URL to redirect to when the user clicks the message ornullto refresh on click
-
handleUnrecoverableError
public void handleUnrecoverableError(String caption, String message, String details, String url, String querySelector)
Shows an error notification for an error which is unrecoverable, using the given parameters.- Parameters:
caption- the caption of the messagemessage- the message bodydetails- message details ornullif there are no detailsurl- a URL to redirect to when the user clicks the message ornullto refresh on clickquerySelector- query selector to find the element under which the error will be added . If element is not found or the selector isnull, body will be used
-
handleError
public void handleError(String errorMessage)
Shows the given error message if not running in production mode and logs it to the console if running in production mode.- Parameters:
errorMessage- the error message to show
-
handleError
public void handleError(Throwable throwable)
Shows an error message if not running in production mode and logs it to the console if running in production mode.- Parameters:
throwable- the throwable which occurred
-
-