@Value.Immutable
public abstract class ErrorType
extends java.lang.Object
ErrorType instance are meant to be compile-time constants in the sense
that the name should not contain information that is available at runtime only. By convention, and in alignment with
the HTTP specification, errors associated with a 4xx HTTP status code are client errors, and errors
associated with a 5xx status are server errors.| Modifier and Type | Class and Description |
|---|---|
static class |
ErrorType.Code |
| Modifier and Type | Field and Description |
|---|---|
static ErrorType |
CONFLICT |
static ErrorType |
FAILED_PRECONDITION |
static ErrorType |
INTERNAL |
static ErrorType |
INVALID_ARGUMENT |
static ErrorType |
NOT_FOUND |
static ErrorType |
PERMISSION_DENIED |
static ErrorType |
REQUEST_ENTITY_TOO_LARGE |
static ErrorType |
TIMEOUT |
static ErrorType |
UNAUTHORIZED |
| Constructor and Description |
|---|
ErrorType() |
| Modifier and Type | Method and Description |
|---|---|
abstract ErrorType.Code |
code()
The
ErrorType.Code of this error. |
static ErrorType |
create(ErrorType.Code code,
java.lang.String name)
Constructs an
ErrorType with the given error ErrorType.Code and name. |
abstract int |
httpErrorCode()
The HTTP error code used to convey this error to HTTP clients.
|
abstract java.lang.String |
name()
The name of this error type.
|
public static final ErrorType UNAUTHORIZED
public static final ErrorType PERMISSION_DENIED
public static final ErrorType INVALID_ARGUMENT
public static final ErrorType REQUEST_ENTITY_TOO_LARGE
public static final ErrorType NOT_FOUND
public static final ErrorType CONFLICT
public static final ErrorType FAILED_PRECONDITION
public static final ErrorType INTERNAL
public static final ErrorType TIMEOUT
public abstract ErrorType.Code code()
ErrorType.Code of this error.public abstract java.lang.String name()
public abstract int httpErrorCode()
public static ErrorType create(ErrorType.Code code, java.lang.String name)
ErrorType with the given error ErrorType.Code and name.