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
243 def initialize(request, error, options)
244   @request = request
245   @error = error
246   @options = Options.new(options)
247   log_exception(@error)
248 end

Public Instance methods

method_missing (meth, *, &block)

rubocop:disable Style/MissingRespondToMissing

[show source]
    # File lib/httpx/response.rb
259 def method_missing(meth, *, &block)
260   raise NoMethodError, "undefined response method `#{meth}' for error response" if Response.public_method_defined?(meth)
261 
262   super
263 end
raise_for_status ()
[show source]
    # File lib/httpx/response.rb
254 def raise_for_status
255   raise @error
256 end
status ()
[show source]
    # File lib/httpx/response.rb
250 def status
251   @error.message
252 end