Exception: Cent::ResponseError

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

Overview

Raised when Centrifugo returns a top-level ‘error` in the response body (API-level failure, e.g., unknown channel, namespace not found). Exposes Centrifugo’s numeric ‘code` and human-readable `message`. See centrifugal.dev/docs/server/server_api#error for the full list of codes.

Note: for ‘batch` and `broadcast`, individual sub-reply errors are NOT raised — those responses contain an array of independent replies, and each entry should be inspected by the caller for its own `error` key.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code:, message:) ⇒ ResponseError

Returns a new instance of ResponseError.



41
42
43
44
# File 'lib/cent/error.rb', line 41

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

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



39
40
41
# File 'lib/cent/error.rb', line 39

def code
  @code
end