Method: HTTPX::Response#raise_for_status

Defined in:
lib/httpx/response.rb

#raise_for_statusObject

it raises the exception returned by error, or itself otherwise.

ok_response.raise_for_status #=> ok_response
not_found_response.raise_for_status #=> raises HTTPX::HTTPError exception


149
150
151
152
153
# File 'lib/httpx/response.rb', line 149

def raise_for_status
  return self unless (err = error)

  raise err
end