public class PreferredMediaTypeHttpErrorHandler extends Object implements HttpErrorHandler
Constructor and Description |
---|
PreferredMediaTypeHttpErrorHandler(LinkedHashMap<String,HttpErrorHandler> errorHandlerMap) |
Modifier and Type | Method and 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.
|
protected HttpErrorHandler |
preferred(Http.RequestHeader request) |
public PreferredMediaTypeHttpErrorHandler(LinkedHashMap<String,HttpErrorHandler> errorHandlerMap)
protected HttpErrorHandler preferred(Http.RequestHeader request)
public CompletionStage<Result> onClientError(Http.RequestHeader request, int statusCode, String message)
HttpErrorHandler
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.public CompletionStage<Result> onServerError(Http.RequestHeader request, Throwable exception)
HttpErrorHandler
onServerError
in interface HttpErrorHandler
request
- The request that triggered the server error.exception
- The server error.