Package io.vertx.mutiny.ext.web.handler
Class ErrorHandler
java.lang.Object
io.vertx.mutiny.ext.web.handler.ErrorHandler
- All Implemented Interfaces:
MutinyDelegate,io.vertx.core.Handler<RoutingContext>,Consumer<RoutingContext>
public class ErrorHandler
extends Object
implements io.vertx.core.Handler<RoutingContext>, Consumer<RoutingContext>, MutinyDelegate
A pretty error handler for rendering error pages. When working in development mode
exception details will be returned in the server responses, otherwise or when
manually specified no exception details are returned in the HTTP response.
The reason the display of the exception details is by default dependent of the mode
is to follow the security best practices:
https://www.owasp.org/index.php/Improper_Error_Handling
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Tim Fox, Paulo Lopes
- See Also:
-
ErrorHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TypeArg<ErrorHandler>static final StringThe default template to use for rendering -
Constructor Summary
ConstructorsConstructorDescriptionErrorHandler(io.vertx.ext.web.handler.ErrorHandler delegate) Create a new instance ofErrorHandlerdelegating to the given (non-null) instance ofErrorHandler.ErrorHandler(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(RoutingContext item) Handle an item.static ErrorHandlerCreate an error handler using defaultsstatic ErrorHandlerCreate an error handlerstatic ErrorHandlerCreate an error handlerstatic ErrorHandlerCreate an error handlerbooleanio.vertx.ext.web.handler.ErrorHandlerGet the delegate instance.voidhandle(RoutingContext item) Handle an item.inthashCode()static ErrorHandlernewInstance(io.vertx.ext.web.handler.ErrorHandler delegate) Creates a new instance of theErrorHandler.toString()
-
Field Details
-
DEFAULT_ERROR_HANDLER_TEMPLATE
The default template to use for rendering- See Also:
-
__TYPE_ARG
-
-
Constructor Details
-
ErrorHandler
public ErrorHandler(io.vertx.ext.web.handler.ErrorHandler delegate) Create a new instance ofErrorHandlerdelegating to the given (non-null) instance ofErrorHandler. -
ErrorHandler
-
-
Method Details
-
accept
Handle an item. This method is generated from theoriginalmethod."- Specified by:
acceptin interfaceConsumer<RoutingContext>
-
handle
Handle an item. This method is generated from theoriginalmethod."- Specified by:
handlein interfaceio.vertx.core.Handler<RoutingContext>
-
getDelegate
public io.vertx.ext.web.handler.ErrorHandler getDelegate()Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate instance
-
create
Create an error handler using defaults- Returns:
- the handler
-
create
public static ErrorHandler create(Vertx vertx, String errorTemplateName, boolean displayExceptionDetails) Create an error handler- Parameters:
errorTemplateName- the error template name - will be looked up from the classpathdisplayExceptionDetails- true if exception details should be displayed- Returns:
- the handler
-
create
Create an error handler- Parameters:
displayExceptionDetails- true if exception details should be displayed- Returns:
- the handler
-
create
Create an error handler- Parameters:
errorTemplateName- the error template name - will be looked up from the classpath- Returns:
- the handler
-
newInstance
Creates a new instance of theErrorHandler. -
hashCode
public int hashCode() -
equals
-
toString
-