com.vaadin.server.
Class DefaultErrorHandler
- java.lang.Object
-
- com.vaadin.server.DefaultErrorHandler
-
All Implemented Interfaces:
public class DefaultErrorHandler extends Object implements ErrorHandler
See Also:
-
-
Constructor Summary
Constructors Constructor Description DefaultErrorHandler()
-
Method Summary
All Methods Modifier and Type Method Description static void
doDefault(ErrorEvent event)
void
error(ErrorEvent event)
Invoked when an error occurs.
static AbstractComponent
findAbstractComponent(ErrorEvent event)
Returns the AbstractComponent associated with the given error if such can be found.
static Component
findComponent(Connector connector)
Finds the nearest component by traversing upwards in the hierarchy.
static Throwable
findRelevantThrowable(Throwable t)
Vaadin wraps exceptions in its own and due to reflection usage there might be also other irrelevant exceptions that make no sense for Vaadin users (~developers using Vaadin).
-
-
-
Method Detail
-
error
public void error(ErrorEvent event)
Description copied from interface:
ErrorHandler
Invoked when an error occurs.
Specified by:
error
in interfaceErrorHandler
Parameters:
event
- the fired event.
-
doDefault
public static void doDefault(ErrorEvent event)
-
findRelevantThrowable
public static Throwable findRelevantThrowable(Throwable t)
Vaadin wraps exceptions in its own and due to reflection usage there might be also other irrelevant exceptions that make no sense for Vaadin users (~developers using Vaadin). This method tries to choose the relevant one to be reported.
Parameters:
t
- a throwable passed to ErrorHandlerReturns:
the throwable that is relevant for Vaadin users
Since:
7.2
-
findAbstractComponent
public static AbstractComponent findAbstractComponent(ErrorEvent event)
Returns the AbstractComponent associated with the given error if such can be found.
Parameters:
event
- The error to investigateReturns:
The
AbstractComponent
to error relates to or null if could not be determined or if the error does not relate to any AbstractComponent.
-
findComponent
public static Component findComponent(Connector connector)
Finds the nearest component by traversing upwards in the hierarchy. If connector is a Component, that Component is returned. Otherwise, looks upwards in the hierarchy until it finds a
Component
.Returns:
A Component or null if no component was found
-
-