Exception: Chassis::HttpRequestFailedError
- Inherits:
-
StandardError
- Object
- StandardError
- Chassis::HttpRequestFailedError
- Defined in:
- lib/chassis/faraday.rb
Instance Method Summary collapse
- #body ⇒ Object
- #description ⇒ Object
-
#initialize(env) ⇒ HttpRequestFailedError
constructor
A new instance of HttpRequestFailedError.
- #method ⇒ Object
- #status ⇒ Object
- #to_s ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(env) ⇒ HttpRequestFailedError
Returns a new instance of HttpRequestFailedError.
3 4 5 |
# File 'lib/chassis/faraday.rb', line 3 def initialize(env) @env = env end |
Instance Method Details
#body ⇒ Object
15 16 17 |
# File 'lib/chassis/faraday.rb', line 15 def body env.fetch :body end |
#description ⇒ Object
27 28 29 |
# File 'lib/chassis/faraday.rb', line 27 def description ::Rack::Utils::HTTP_STATUS_CODES.fetch status, 'UNKOWN' end |
#method ⇒ Object
11 12 13 |
# File 'lib/chassis/faraday.rb', line 11 def method env.fetch(:method).upcase end |
#status ⇒ Object
23 24 25 |
# File 'lib/chassis/faraday.rb', line 23 def status env.fetch :status end |
#to_s ⇒ Object
7 8 9 |
# File 'lib/chassis/faraday.rb', line 7 def to_s "#{status} - #{description} : #{method} #{url}" end |
#url ⇒ Object
19 20 21 |
# File 'lib/chassis/faraday.rb', line 19 def url env.fetch(:url) end |