public interface ErrorHandler
Modifier and Type | Method and Description |
---|---|
void |
apply(Context ctx,
Throwable cause,
StatusCode code)
Produces an error response using the given exception and status code.
|
static DefaultErrorHandler |
create()
Creates a default error handler.
|
static String |
errorMessage(Context ctx,
StatusCode statusCode)
Build a line error message that describe the current web context and the status code.
|
default ErrorHandler |
then(ErrorHandler next)
Chain this error handler with next and produces a new error handler.
|
@Nonnull void apply(@Nonnull Context ctx, @Nonnull Throwable cause, @Nonnull StatusCode code)
ctx
- Web context.cause
- Application error.code
- Status code.@Nonnull default ErrorHandler then(@Nonnull ErrorHandler next)
next
- Next error handler.@Nonnull static String errorMessage(@Nonnull Context ctx, @Nonnull StatusCode statusCode)
GET /path Status-Code Status-Reason
ctx
- Web context.statusCode
- Status code.@Nonnull static DefaultErrorHandler create()
Copyright © 2020. All rights reserved.