public final class TransportErrorCode
extends Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static TransportErrorCode |
BadRequest
A bad request, most often this will be equivalent to unsupported data.
|
static TransportErrorCode |
Forbidden
A particular operation was forbidden.
|
static TransportErrorCode |
GoingAway
Going away, thrown when the service is unavailable or going away.
|
static TransportErrorCode |
InternalServerError
An internal server error, equivalent to Unexpected Condition.
|
static TransportErrorCode |
MethodNotAllowed
The method being used is not allowed.
|
static TransportErrorCode |
NotAcceptable
The server can't generate a response that meets the clients accepted response types.
|
static TransportErrorCode |
NotFound
A resource was not found, equivalent to policy violation.
|
static TransportErrorCode |
PayloadTooLarge
The payload of a message is too large.
|
static TransportErrorCode |
PolicyViolation
A generic error to used to indicate that the end receiving the error message violated the remote ends policy.
|
static TransportErrorCode |
ProtocolError
A protocol error, or bad request.
|
static TransportErrorCode |
ServiceUnavailable
Service unavailable, thrown when the service is unavailable or going away.
|
static TransportErrorCode |
UnexpectedCondition
A generic error used to indicate that the end sending the error message because it encountered an unexpected
condition.
|
static TransportErrorCode |
UnsupportedData
An application level protocol error, such as when a client or server sent data that can't be deserialized.
|
static TransportErrorCode |
UnsupportedMediaType
The client or server doesn't know how to deserialize the request or response.
|
Modifier and Type | Method and Description |
---|---|
String |
description()
A description of this close code.
|
boolean |
equals(Object o) |
static TransportErrorCode |
fromHttp(int code)
Get a transport error code from the given HTTP error code.
|
static TransportErrorCode |
fromWebSocket(int code)
Get a transport error code from the given WebSocket close code.
|
int |
hashCode() |
int |
http()
The HTTP status code for this error.
|
String |
toString() |
int |
webSocket()
The WebSocket close code for this error.
|
public static final TransportErrorCode ProtocolError
public static final TransportErrorCode UnsupportedData
public static final TransportErrorCode BadRequest
public static final TransportErrorCode Forbidden
public static final TransportErrorCode PolicyViolation
public static final TransportErrorCode NotFound
public static final TransportErrorCode MethodNotAllowed
public static final TransportErrorCode NotAcceptable
public static final TransportErrorCode PayloadTooLarge
public static final TransportErrorCode UnsupportedMediaType
public static final TransportErrorCode UnexpectedCondition
public static final TransportErrorCode InternalServerError
public static final TransportErrorCode ServiceUnavailable
public static final TransportErrorCode GoingAway
public static TransportErrorCode fromHttp(int code)
code
- The HTTP error code, must be between 400 and 599 inclusive.IllegalArgumentException
- if the HTTP code was not between 400 and 599.public static TransportErrorCode fromWebSocket(int code)
code
- The WebSocket close code, must be between 0 and 65535 inclusive.IllegalArgumentException
- if the code is not an unsigned 2 byte integer.public int http()
public int webSocket()
public String description()
"Unknown error code"
.public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object