Package com.vaadin.flow.server
Class FailedUIRequestException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.vaadin.flow.server.FailedUIRequestException
- All Implemented Interfaces:
Serializable
Carries the exception that made a
SynchronizedRequestHandler fail
together with the UI that was current when it failed.
The handler restores the current instances when it unlocks the session, so
the UI is no longer current when the exception reaches the error handling in
VaadinService. The error handling unwraps the exception and makes the
UI current again while it holds the session lock. Other code that calls
SynchronizedRequestHandler.handleRequest(VaadinSession, VaadinRequest, VaadinResponse)
directly can catch this exception and handle the original exception from
getCause().
- Since:
- 25.5
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFailedUIRequestException(Exception failure, UI ui) Creates a new exception for the given failure and UI. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
FailedUIRequestException
Creates a new exception for the given failure and UI.- Parameters:
failure- the exception that made the request handler fail, notnullui- the UI that was current when the request handler failed, notnull
-
-
Method Details
-
getCause
Gets the exception that made the request handler fail. -
getUI
Gets the UI that was current when the request handler failed.The session of the UI is not locked when this exception is thrown, so lock it, for example with
UI.access(com.vaadin.flow.server.Command), before using the UI.- Returns:
- the UI, or
nullif this exception has been deserialized
-