class HTTPX::ErrorResponse

  1. lib/httpx/response.rb
Superclass: Object

Methods

Public Class

  1. new

Public Instance

  1. error
  2. method_missing
  3. raise_for_status
  4. request
  5. status

Included modules

  1. Loggable

Attributes

error [R]
request [R]

Public Class methods

new (request, error, options)
[show source]
    # File lib/httpx/response.rb
261 def initialize(request, error, options)
262   @request = request
263   @error = error
264   @options = Options.new(options)
265   log_exception(@error)
266 end

Public Instance methods

method_missing (meth, *, &block)

rubocop:disable Style/MissingRespondToMissing

[show source]
    # File lib/httpx/response.rb
277 def method_missing(meth, *, &block)
278   raise NoMethodError, "undefined response method `#{meth}' for error response" if Response.public_method_defined?(meth)
279 
280   super
281 end
raise_for_status ()
[show source]
    # File lib/httpx/response.rb
272 def raise_for_status
273   raise @error
274 end
status ()
[show source]
    # File lib/httpx/response.rb
268 def status
269   @error.message
270 end