Exception: MyERP::HTTPError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response, params = {}) ⇒ HTTPError

Returns a new instance of HTTPError.



8
9
10
11
12
# File 'lib/myerp/errors.rb', line 8

def initialize(response, params = {})
  @response = response
  @params = params
  super(response)
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



6
7
8
# File 'lib/myerp/errors.rb', line 6

def params
  @params
end

#responseObject (readonly)

Returns the value of attribute response.



5
6
7
# File 'lib/myerp/errors.rb', line 5

def response
  @response
end

Instance Method Details

#to_sObject



14
15
16
# File 'lib/myerp/errors.rb', line 14

def to_s
  "#{self.class.to_s} : #{response.code} #{response.body}"
end