public interface ErrorHandler
Modifier and Type | Field and Description |
---|---|
static ErrorHandler |
DEFAULT
Default error handler with support for content-negotiation.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(Context ctx,
Throwable cause,
StatusCode statusCode)
Produces an error response using the given exception and status code.
|
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.
|
static final ErrorHandler DEFAULT
@Nonnull void apply(@Nonnull Context ctx, @Nonnull Throwable cause, @Nonnull StatusCode statusCode)
ctx
- Web context.cause
- Application error.statusCode
- 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.Copyright © 2019. All rights reserved.