public class MissingRequestParametersWebErrorHandler extends Object implements WebErrorHandler
We chose to handle those exceptions here (and not in SpringMvcWebErrorHandler),
because this way we can conditionally register this handler iff those exceptions are
present in the classpath.
| Modifier and Type | Field and Description |
|---|---|
static String |
MISSING_COOKIE
A required cookie is missing from the request.
|
static String |
MISSING_HEADER
A required header is missing from the request.
|
static String |
MISSING_MATRIX_VARIABLE
A required matrix variable is missing from the request.
|
| Constructor and Description |
|---|
MissingRequestParametersWebErrorHandler() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canHandle(Throwable exception)
Only can handle exceptions about missing required headers, cookies or matrix variables.
|
HandledException |
handle(Throwable exception)
Handles the given exception by selecting the appropriate error code, status code and
to-be-exposed arguments conditionally.
|
public static final String MISSING_HEADER
public static final String MISSING_COOKIE
public static final String MISSING_MATRIX_VARIABLE
public MissingRequestParametersWebErrorHandler()
public boolean canHandle(Throwable exception)
canHandle in interface WebErrorHandlerexception - The exception to examine.true when the exception is related to missing required headers, cookies or
matrix variables, false otherwise.@NonNull public HandledException handle(Throwable exception)
handle in interface WebErrorHandlerexception - The exception to handle.Copyright © 2018. All rights reserved.