Package com.vaadin.browserless.internal
Class MockRouteNotFoundError
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.router.AbstractRouteNotFoundError
com.vaadin.flow.router.RouteNotFoundError
com.vaadin.browserless.internal.MockRouteNotFoundError
- All Implemented Interfaces:
AttachNotifier,DetachNotifier,HasElement,HasStyle,HasErrorParameter<NotFoundException>,Serializable
This route gets registered by default in
Routes, so that Browserless
Testing can catch any navigation to a missing route and can respond with an
informative exception.
For internal use only. May be renamed or removed in a future release.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.router.AbstractRouteNotFoundError
AbstractRouteNotFoundError.CopilotJs -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal NotFoundExceptiongetCause()Returns the exception describing the failed navigation, set bysetErrorParameter(BeforeEnterEvent, ErrorParameter).final voidsetCause(NotFoundException cause) Sets the exception describing the failed navigation.intsetErrorParameter(BeforeEnterEvent event, ErrorParameter<NotFoundException> parameter) Callback executed before rendering the exception view.Methods inherited from class com.vaadin.flow.router.AbstractRouteNotFoundError
setRouteNotFoundErrorParameterMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, getUIOrThrow, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisible, whenAttachedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Constructor Details
-
MockRouteNotFoundError
public MockRouteNotFoundError()Creates the error view.
-
-
Method Details
-
getCause
Returns the exception describing the failed navigation, set bysetErrorParameter(BeforeEnterEvent, ErrorParameter).- Returns:
- the exception, or null if no navigation failed yet.
-
setCause
Sets the exception describing the failed navigation.- Parameters:
cause- the exception, may be null.
-
setErrorParameter
Description copied from interface:HasErrorParameterCallback executed before rendering the exception view.Note! returned int should be a valid
HttpStatusCodecode- Specified by:
setErrorParameterin interfaceHasErrorParameter<NotFoundException>- Overrides:
setErrorParameterin classRouteNotFoundError- Parameters:
event- the before navigation event for this requestparameter- error parameter containing custom exception and caught exception- Returns:
- a valid
HttpStatusCodecode
-