Package play.http
Interface HttpErrorHandler
-
- All Known Implementing Classes:
DefaultHttpErrorHandler
,HtmlOrJsonHttpErrorHandler
,JsonHttpErrorHandler
,PreferredMediaTypeHttpErrorHandler
public interface HttpErrorHandler
Component for handling HTTP errors in Play.- Since:
- 2.4.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
HttpErrorHandler.Attrs
Request attributes used by the error handler.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompletionStage<Result>
onClientError(Http.RequestHeader request, int statusCode, String message)
Invoked when a client error occurs, that is, an error in the 4xx series.CompletionStage<Result>
onServerError(Http.RequestHeader request, Throwable exception)
Invoked when a server error occurs.
-
-
-
Method Detail
-
onClientError
CompletionStage<Result> onClientError(Http.RequestHeader request, int statusCode, String message)
Invoked when a client error occurs, that is, an error in the 4xx series.- Parameters:
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.- Returns:
- a CompletionStage with the Result.
-
onServerError
CompletionStage<Result> onServerError(Http.RequestHeader request, Throwable exception)
Invoked when a server error occurs.- Parameters:
request
- The request that triggered the server error.exception
- The server error.- Returns:
- a CompletionStage with the Result.
-
-