class Starling::Errors::BaseError
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
Public Class Methods
new(env)
click to toggle source
@param env The Faraday environment, providing access to the response
# File lib/starling/errors/base_error.rb, line 12 def initialize(env) @env = env end
Public Instance Methods
message()
click to toggle source
@return [String] a helpful message explaining the error, incorporating the
HTTP status code and body returned
# File lib/starling/errors/base_error.rb, line 21 def message message = status.to_s message += ": #{body}" if body message end
Also aliased as: to_s