class Faraday::Error
Faraday error base class.
def backtrace
def backtrace if @wrapped_exception @wrapped_exception.backtrace else super end end
def initialize(exc, response = nil)
def initialize(exc, response = nil) @wrapped_exception = nil @response = response if exc.respond_to?(:backtrace) super(exc.message) @wrapped_exception = exc elsif exc.respond_to?(:each_key) super("the server responded with status #{exc[:status]}") @response = exc else super(exc.to_s) end end
def inspect
def inspect inner = +'' inner << " wrapped=#{@wrapped_exception.inspect}" if @wrapped_exception inner << " response=#{@response.inspect}" if @response inner << " #{super}" if inner.empty? %(#<#{self.class}#{inner}>) end