Exception: Stellwerk::ApiError

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

Overview

Raised when API communication fails

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status_code: nil, response_body: nil) ⇒ ApiError

Returns a new instance of ApiError.



29
30
31
32
33
# File 'lib/stellwerk/errors.rb', line 29

def initialize(message, status_code: nil, response_body: nil)
  super(message)
  @status_code = status_code
  @response_body = response_body
end

Instance Attribute Details

#response_body ⇒ Object (readonly)

Returns the value of attribute response_body.



27
28
29
# File 'lib/stellwerk/errors.rb', line 27

def response_body
  @response_body
end

#status_code ⇒ Object (readonly)

Returns the value of attribute status_code.



27
28
29
# File 'lib/stellwerk/errors.rb', line 27

def status_code
  @status_code
end