Exception: CSTM2::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/cstm2.rb

Overview

Raised for any non-2xx CSTM-2 API response.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, code = 'api_error', status = 500) ⇒ Error

Returns a new instance of Error.



21
22
23
24
25
# File 'lib/cstm2.rb', line 21

def initialize(message, code = 'api_error', status = 500)
  super(message)
  @code = code
  @status = status
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



19
20
21
# File 'lib/cstm2.rb', line 19

def code
  @code
end

#statusObject (readonly)

Returns the value of attribute status.



19
20
21
# File 'lib/cstm2.rb', line 19

def status
  @status
end