Module: Faraday::Conductivity::Error

Defined in:
lib/faraday/conductivity/selective_errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#requestObject

Returns the value of attribute request.



6
7
8
# File 'lib/faraday/conductivity/selective_errors.rb', line 6

def request
  @request
end

#responseObject

Returns the value of attribute response.



6
7
8
# File 'lib/faraday/conductivity/selective_errors.rb', line 6

def response
  @response
end

#response_timeObject

Returns the value of attribute response_time.



6
7
8
# File 'lib/faraday/conductivity/selective_errors.rb', line 6

def response_time
  @response_time
end

Instance Method Details

#initializeObject



8
9
10
11
12
# File 'lib/faraday/conductivity/selective_errors.rb', line 8

def initialize(*)
  @request  = {}
  @response = {}
  super
end

#inspectObject



22
23
24
# File 'lib/faraday/conductivity/selective_errors.rb', line 22

def inspect
  "<#{self.class}> #{message}"
end

#messageObject



14
15
16
17
18
19
20
# File 'lib/faraday/conductivity/selective_errors.rb', line 14

def message
  if @wrapped_exception
    "#{@wrapped_exception.class}: #{super}"
  else
    "#{request[:method].to_s.upcase} #{request[:url]} responded with status #{response[:status]}"
  end
end