Exception: Escobar::Client::HTTPError

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

Overview

Class for returning API errors to escobar clients

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



19
20
21
# File 'lib/escobar/client.rb', line 19

def body
  @body
end

#headersObject

Returns the value of attribute headers.



19
20
21
# File 'lib/escobar/client.rb', line 19

def headers
  @headers
end

#statusObject

Returns the value of attribute status.



19
20
21
# File 'lib/escobar/client.rb', line 19

def status
  @status
end

Class Method Details

.from_response(err) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/escobar/client.rb', line 20

def self.from_response(err)
  error = new("Error from Heroku API")

  error.body    = err.response[:body]
  error.headers = err.response[:headers]
  error.status  = err.response[:status]

  error.set_backtrace(err.backtrace)
  error
end