@Value.Immutable
public abstract class SerializableError
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
SerializableError.Builder |
| Constructor and Description |
|---|
SerializableError() |
| Modifier and Type | Method and Description |
|---|---|
static SerializableError.Builder |
builder() |
java.lang.String |
errorCode()
A fixed code word identifying the type of error.
|
java.lang.String |
errorInstanceId()
A unique identifier for this error instance, typically used to correlate errors displayed in user-facing
applications with richer backend-level error information.
|
java.lang.String |
errorName()
A fixed name identifying the error.
|
static SerializableError |
forException(ServiceException exception)
Creates a
SerializableError representation of this exception that derives from the error code and
message, as well as the safe and unsafe parameters. |
abstract java.util.Map<java.lang.String,java.lang.String> |
parameters()
A set of parameters that further explain the error.
|
@Value.Default public java.lang.String errorCode()
ServiceException, this
corresponds to the ErrorType.code() and is part of the service's API surface. Clients are given access to
the server-side error code via RemoteException.getError() and typically switch&dispatch on the error code
and/or name.@Value.Default public java.lang.String errorName()
ServiceException, this corresponding to the
ErrorType.name() and is part of the service's API surface. Clients are given access to the service-side
error name via RemoteException.getError() and typically switch&dispatch on the error code and/or name.@Value.Default public java.lang.String errorInstanceId()
errorCode() and
errorName(), the errorInstanceId() identifies a specific occurrence of an error, not a class of
errors. By convention, this field is a UUID.public abstract java.util.Map<java.lang.String,java.lang.String> parameters()
public static SerializableError forException(ServiceException exception)
SerializableError representation of this exception that derives from the error code and
message, as well as the safe and unsafe parameters.public static SerializableError.Builder builder()