Exception: MetalArchives::Errors::APIError

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

Overview

Error in backend response

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ APIError

Returns a new instance of APIError.



38
39
40
41
42
# File 'lib/metal_archives/errors.rb', line 38

def initialize(response)
  super("#{response.reason}: #{response.body}")

  @code = response.code
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



36
37
38
# File 'lib/metal_archives/errors.rb', line 36

def code
  @code
end