- All Implemented Interfaces:
Serializable
,Comparable<HttpExceptionHandling>
,java.lang.constant.Constable
public enum HttpExceptionHandling extends Enum<HttpExceptionHandling>
Defines how errors affect the HTTP-Body whilst processing a
HttpRequest
or a HttpResponse
along with the according
sub-classes. Usually the following fields are written into the HTTP-Body (if
possible): "timestamp", "status", "error": "Bad Request", "exception" and
"message". Usually the causing exception's message is used for the "message"
attribute: Make sure you do not reveal any sensible information in the
exception's message.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants Enum Constant Description EMPTY
Create a new HTTP-Response with the according HTTP-Status-Code and and an empty body.KEEP
Do not modify the so far processed HTTP-Response except update the actual HTTP-Status-Code.MERGE
Keep the so far processed HTTP-Response as is except update the actual HTTP-Status-Code, add only non-existing fields if possible with the error description fields.REPLACE
Create a new HTTP-Response with the according HTTP-Status-Code and the error description fields.UPDATE
Keep the so far processed HTTP-Response as is except the HTTP-Status-Code and also update all error description fields. -
Method Summary
Modifier and Type Method Description static HttpExceptionHandling
valueOf(String name)
Returns the enum constant of this type with the specified name.static HttpExceptionHandling[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
KEEP
Do not modify the so far processed HTTP-Response except update the actual HTTP-Status-Code. Useful when you manually prepared the HTTP-Response yourself. -
MERGE
Keep the so far processed HTTP-Response as is except update the actual HTTP-Status-Code, add only non-existing fields if possible with the error description fields. Useful when you manually prepared the HTTP-Response yourself. -
UPDATE
Keep the so far processed HTTP-Response as is except the HTTP-Status-Code and also update all error description fields. Useful when you want to preserve already set fields. -
REPLACE
Create a new HTTP-Response with the according HTTP-Status-Code and the error description fields. -
EMPTY
Create a new HTTP-Response with the according HTTP-Status-Code and and an empty body.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-