public class DefaultHttpErrorHandler extends java.lang.Object implements HttpErrorHandler
Constructor and Description |
---|
DefaultHttpErrorHandler(Configuration configuration,
Environment environment,
play.api.OptionalSourceMapper sourceMapper,
javax.inject.Provider<play.api.routing.Router> routes) |
Modifier and Type | Method and Description |
---|---|
protected void |
logServerError(Http.RequestHeader request,
play.api.UsefulException usefulException)
Responsible for logging server errors.
|
protected F.Promise<Result> |
onBadRequest(Http.RequestHeader request,
java.lang.String message)
Invoked when a client makes a bad request.
|
F.Promise<Result> |
onClientError(Http.RequestHeader request,
int statusCode,
java.lang.String message)
Invoked when a client error occurs, that is, an error in the 4xx series.
|
protected F.Promise<Result> |
onDevServerError(Http.RequestHeader request,
play.api.UsefulException exception)
Invoked in dev mode when a server error occurs.
|
protected F.Promise<Result> |
onForbidden(Http.RequestHeader request,
java.lang.String message)
Invoked when a client makes a request that was forbidden.
|
protected F.Promise<Result> |
onNotFound(Http.RequestHeader request,
java.lang.String message)
Invoked when a handler or resource is not found.
|
protected F.Promise<Result> |
onProdServerError(Http.RequestHeader request,
play.api.UsefulException exception)
Invoked in prod mode when a server error occurs.
|
F.Promise<Result> |
onServerError(Http.RequestHeader request,
java.lang.Throwable exception)
Invoked when a server error occurs.
|
@Inject public DefaultHttpErrorHandler(Configuration configuration, Environment environment, play.api.OptionalSourceMapper sourceMapper, javax.inject.Provider<play.api.routing.Router> routes)
public F.Promise<Result> onClientError(Http.RequestHeader request, int statusCode, java.lang.String message)
onClientError
in interface HttpErrorHandler
request
- The request that caused the client error.statusCode
- The error status code. Must be greater or equal to 400, and less than 500.message
- The error message.protected F.Promise<Result> onBadRequest(Http.RequestHeader request, java.lang.String message)
request
- The request that was bad.message
- The error message.protected F.Promise<Result> onForbidden(Http.RequestHeader request, java.lang.String message)
request
- The forbidden request.message
- The error message.protected F.Promise<Result> onNotFound(Http.RequestHeader request, java.lang.String message)
request
- The request that no handler was found to handle.message
- A message.public F.Promise<Result> onServerError(Http.RequestHeader request, java.lang.Throwable exception)
onServerError
in interface HttpErrorHandler
request
- The request that triggered the server error.exception
- The server error.protected void logServerError(Http.RequestHeader request, play.api.UsefulException usefulException)
request
- The request that triggered the server error.usefulException
- The server error.protected F.Promise<Result> onDevServerError(Http.RequestHeader request, play.api.UsefulException exception)
request
- The request that triggered the error.exception
- The exception.protected F.Promise<Result> onProdServerError(Http.RequestHeader request, play.api.UsefulException exception)
request
- The request that triggered the error.exception
- The exception.