Exception: Rubycent::ResponseError

Inherits:
Error
  • Object
show all
Defined in:
lib/rubycent/errors/response_error.rb

Overview

Rubycent::ResponseError

Raised when response from Centrifugo contains any error as result of API command execution.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_data) ⇒ ResponseError

Returns a new instance of ResponseError.



11
12
13
14
15
# File 'lib/rubycent/errors/response_error.rb', line 11

def initialize(error_data)
  @message, @code = error_data.values_at('message', 'code')

  super(@message)
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



9
10
11
# File 'lib/rubycent/errors/response_error.rb', line 9

def code
  @code
end

#messageObject (readonly)

Returns the value of attribute message.



9
10
11
# File 'lib/rubycent/errors/response_error.rb', line 9

def message
  @message
end