Exception: Lich::Common::WebSocket::Frame::ProtocolError

Inherits:
StandardError
  • Object
show all
Defined in:
documented/common/websocket/frame.rb

Overview

Raised for any structural framing violation: reserved bits set, an unsupported opcode, an oversized/fragmented control frame, a continuation frame with no message in progress, or -- per RFC 6455 5.1 -- a masked frame arriving from the server.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil) ⇒ void

Initializes a ProtocolError with an optional message and an empty decoded_messages array.

Parameters:

  • message (String, nil) (defaults to: nil) —

    error message



77
78
79
80
# File 'documented/common/websocket/frame.rb', line 77

def initialize(message = nil)
  super
  @decoded_messages = []
end

Instance Attribute Details

#decoded_messages ⇒ Array<Message>

Returns messages Reader#feed had already decoded from this same call's bytes before hitting the violation -- often the last data a caller will see before the connection is torn down, so worth handing back rather than discarding along with the raised error. Empty unless the Reader that raised this populated it.

Returns:

  • (Array<Message>) —

    messages Reader#feed had already decoded from this same call's bytes before hitting the violation -- often the last data a caller will see before the connection is torn down, so worth handing back rather than discarding along with the raised error. Empty unless the Reader that raised this populated it.



71
72
73
# File 'documented/common/websocket/frame.rb', line 71

def decoded_messages
  @decoded_messages
end