The exception class for HTTP responses with 4xx or 5xx status.
Attributes
response | [R] |
The |
Public Class methods
new(response)
Creates the instance and assigns the HTTPX::Response
response
.
[show source]
# File lib/httpx/errors.rb 103 def initialize(response) 104 @response = response 105 super("HTTP Error: #{@response.status} #{@response.headers}\n#{@response.body}") 106 end
Public Instance methods
status()
The HTTP response status.
error.status #=> 404
[show source]
# File lib/httpx/errors.rb 111 def status 112 @response.status 113 end