Class: Protocol::WebSocket::ProtocolError

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

Overview

Raised by stream or connection handlers, results in GOAWAY frame which signals termination of the current connection. You cannot recover from this exception, or any exceptions subclassed from it.

Direct Known Subclasses

ClosedError, FrameSizeError

Constant Summary

Constants inherited from Error

Error::GOING_AWAY, Error::INTERNAL_ERROR, Error::INVALID_DATA, Error::INVALID_PAYLOAD, Error::MESSAGE_TOO_LARGE, Error::MISSING_EXTENSION, Error::NO_ERROR, Error::POLICY_VIOLATION, Error::PROTOCOL_ERROR

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, code = PROTOCOL_ERROR) ⇒ ProtocolError

Initialize a protocol error with an optional status code.



47
48
49
50
51
# File 'lib/protocol/websocket/error.rb', line 47

def initialize(message, code = PROTOCOL_ERROR)
	super(message)
	
	@code = code
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



54
55
56
# File 'lib/protocol/websocket/error.rb', line 54

def code
  @code
end

#The status code associated with the error.(statuscodeassociatedwiththeerror.) ⇒ Object (readonly)



54
# File 'lib/protocol/websocket/error.rb', line 54

attr :code