Class: Protocol::WebSocket::Error

Inherits:
HTTP::Error
  • Object
show all
Defined in:
lib/protocol/websocket/error.rb

Overview

Represents an error that occurred during the WebSocket protocol negotiation or communication. Status codes as defined by <tools.ietf.org/html/rfc6455#section-7.4.1>.

Direct Known Subclasses

ProtocolError

Constant Summary collapse

NO_ERROR =

Indicates a normal closure, meaning that the purpose for which the connection was established has been fulfilled.

1000
GOING_AWAY =

Indicates that an endpoint is “going away”, such as a server going down or a browser having navigated away from a page.

1001
PROTOCOL_ERROR =

Indicates that an endpoint is terminating the connection due to a protocol error.

1002
INVALID_DATA =

Indicates that an endpoint is terminating the connection because it has received a type of data it cannot accept. (e.g., an endpoint that understands only text data MAY send this if it receives a binary message).

1003
INVALID_PAYLOAD =

Indicates that an endpoint is terminating the connection because it has received data within a message that was not consistent with the type of the message (e.g., non-UTF-8 data within a text message).

1007
POLICY_VIOLATION =

Indicates that an endpoint is terminating the connection because it has received a message that violates its policy. This is a generic status code that can be returned when there is no other more suitable status code (e.g., 1003 or 1009) or if there is a need to hide specific details about the policy.

1008
MESSAGE_TOO_LARGE =

Indicates that an endpoint is terminating the connection because it has received a message that is too big for it to process.

1009
MISSING_EXTENSION =

Indicates that an endpoint (client) is terminating the connection because it has expected the server to negotiate one or more extension, but the server didn’t return them in the response message of the WebSocket handshake. The list of extensions that are needed should appear in the /reason/ part of the Close frame. Note that this status code is not used by the server, because it can fail the WebSocket handshake instead.

1010
INTERNAL_ERROR =

Indicates that a server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.

1011