Exception: CatalogAPI::Request::Error

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

Overview

CatalogAPI Error

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Error

Returns a new instance of Error.



44
45
46
47
# File 'lib/catalogapi/request.rb', line 44

def initialize(response)
  @body = response.body
  @code = response.code
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



43
44
45
# File 'lib/catalogapi/request.rb', line 43

def body
  @body
end

#codeObject

Returns the value of attribute code.



43
44
45
# File 'lib/catalogapi/request.rb', line 43

def code
  @code
end

Instance Method Details

#messageObject



49
50
51
# File 'lib/catalogapi/request.rb', line 49

def message
  "#{code} #{body}"
end