com.vaadin.flow.server.
Class ErrorEvent
All Implemented Interfaces:
An error thrown by the framework and handled by an ErrorHandler
.
Typically handled by VaadinSession.getErrorHandler()
.
Since:
1.0
See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionErrorEvent
(Throwable throwable) Creates an error event which wraps the given throwable.
ErrorEvent
(Throwable throwable, StateNode componentNode) Create an error event which wraps the given throwable and component for exception.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ErrorHandler
findErrorHandler
(VaadinSession session) Finds the error handler for the given session.
Get the Component that the error was thrown for.
Get the Element that the error was thrown for.
Gets the contained throwable, the cause of the error.
-
Constructor Details
-
ErrorEvent
Creates an error event which wraps the given throwable.
Parameters:
throwable
- the throwable to wrap -
ErrorEvent
Create an error event which wraps the given throwable and component for exception.
Parameters:
throwable
- the throwable to wrapcomponentNode
- stateNode of for exception component.
-
-
Method Details
-
getThrowable
Gets the contained throwable, the cause of the error.
Returns:
the throwable that caused the error
-
getComponent
Get the Component that the error was thrown for. If not known returns empty optional.
Returns:
Component that error happened for if available
-
getElement
Get the Element that the error was thrown for. If not known return empty optional.
Returns:
Element that error happened for if available
-
findErrorHandler
Finds the error handler for the given session.
Parameters:
session
- the active sessionReturns:
An ErrorHandler for the session or null if none was found
-