Exception: Hyperion::WebSocket::HandshakeError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/hyperion/websocket/handshake.rb

Overview

Public end-user API: applications / middleware can ‘rescue` this to know “this was a WS upgrade attempt that failed at validation, NOT an unrelated 4xx”. WS-2 itself doesn’t raise this — it’s supplied for downstream consumers who want to build their own WS facade on top of ‘Handshake.validate`.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, message, extra_headers = {}) ⇒ HandshakeError

Returns a new instance of HandshakeError.



48
49
50
51
52
# File 'lib/hyperion/websocket/handshake.rb', line 48

def initialize(status, message, extra_headers = {})
  super(message)
  @status = status
  @extra_headers = extra_headers
end

Instance Attribute Details

#extra_headersObject (readonly)

Returns the value of attribute extra_headers.



46
47
48
# File 'lib/hyperion/websocket/handshake.rb', line 46

def extra_headers
  @extra_headers
end

#statusObject (readonly)

Returns the value of attribute status.



46
47
48
# File 'lib/hyperion/websocket/handshake.rb', line 46

def status
  @status
end