Exception: Starling::Errors::BaseError
- Inherits:
-
StandardError
- Object
- StandardError
- Starling::Errors::BaseError
- Extended by:
- Forwardable
- Defined in:
- lib/starling/errors/base_error.rb
Overview
A basic implementation of an error thrown from a Faraday::Response::Middleware, receiving the Faraday environment as an argument, providing access to the response status and body
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(env) ⇒ BaseError
constructor
A new instance of BaseError.
-
#message ⇒ String
(also: #to_s)
A helpful message explaining the error, incorporating the HTTP status code and body returned.
Constructor Details
#initialize(env) ⇒ BaseError
Returns a new instance of BaseError.
12 13 14 |
# File 'lib/starling/errors/base_error.rb', line 12 def initialize(env) @env = env end |
Instance Method Details
#message ⇒ String Also known as: to_s
Returns a helpful message explaining the error, incorporating the HTTP status code and body returned.
21 22 23 24 25 26 |
# File 'lib/starling/errors/base_error.rb', line 21 def = status.to_s += ": #{body}" if body end |