public enum LastResortWebErrorHandler extends Enum<LastResortWebErrorHandler> implements WebErrorHandler
WebErrorHandler which will be used when all
other registered handlers refuse to handle a particular exception. You can
also use a custom implementation of WebErrorHandler for this scenario.WebErrorHandler| Enum Constant and Description |
|---|
INSTANCE
The singleton instance!
|
| Modifier and Type | Field and Description |
|---|---|
static String |
UNKNOWN_ERROR_CODE
This error handler simply returns an error code representing an unknown error.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canHandle(Throwable exception)
Since this is the last resort error handler, this value would simply be ignored.
|
HandledException |
handle(Throwable exception)
Always return 500 Internal Error with
unknown_error as the error code with no
arguments. |
static LastResortWebErrorHandler |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static LastResortWebErrorHandler[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final LastResortWebErrorHandler INSTANCE
public static final String UNKNOWN_ERROR_CODE
public static LastResortWebErrorHandler[] values()
for (LastResortWebErrorHandler c : LastResortWebErrorHandler.values()) System.out.println(c);
public static LastResortWebErrorHandler valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic boolean canHandle(Throwable exception)
canHandle in interface WebErrorHandlerexception - The exception to examine.public HandledException handle(Throwable exception)
unknown_error as the error code with no
arguments.handle in interface WebErrorHandlerexception - The exception to handle.unknown_error as the error code.Copyright © 2018. All rights reserved.