Exception: HTTPX::HTTPError

Inherits:
Error
  • Object
show all
Defined in:
lib/httpx/errors.rb,
sig/errors.rbs

Overview

The exception class for HTTP responses with 4xx or 5xx status.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#response ⇒ Response (readonly)

The HTTPX::Response response object this exception refers to.

Returns:



106
107
108
# File 'lib/httpx/errors.rb', line 106

def response
  @response
end

Instance Method Details

#status ⇒ Integer

The HTTP response status.

error.status #=> 404

Returns:

  • (Integer)


117
118
119
# File 'lib/httpx/errors.rb', line 117

def status
  @response.status
end