Exception: Cent::ResponseError
- 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
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
-
#initialize(code:, message:) ⇒ ResponseError
constructor
A new instance of ResponseError.
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() end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
39 40 41 |
# File 'lib/cent/error.rb', line 39 def code @code end |