Exception: Stactics::APIError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status:, body:) ⇒ APIError

Returns a new instance of APIError.



9
10
11
12
13
# File 'lib/stactics/client.rb', line 9

def initialize(status:, body:)
  @status = status
  @body = body
  super(body.fetch("error", "Stactics API request failed"))
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



7
8
9
# File 'lib/stactics/client.rb', line 7

def body
  @body
end

#statusObject (readonly)

Returns the value of attribute status.



7
8
9
# File 'lib/stactics/client.rb', line 7

def status
  @status
end