Exception: Faraday::HTTP::Error
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Faraday::HTTP::Error
- Defined in:
- lib/faraday/http_errors.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Instance Method Summary collapse
- #default_message(env) ⇒ Object
-
#initialize(env, message = nil) ⇒ Error
constructor
A new instance of Error.
- #status ⇒ Object
Constructor Details
#initialize(env, message = nil) ⇒ Error
Returns a new instance of Error.
6 7 8 9 |
# File 'lib/faraday/http_errors.rb', line 6 def initialize(env, =nil) @env = env super || (env) end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
4 5 6 |
# File 'lib/faraday/http_errors.rb', line 4 def env @env end |
Instance Method Details
#default_message(env) ⇒ Object
11 12 13 |
# File 'lib/faraday/http_errors.rb', line 11 def (env) "#{status} from #{env[:url].host}#{env[:url].path}" end |
#status ⇒ Object
15 16 17 |
# File 'lib/faraday/http_errors.rb', line 15 def status env[:status] end |