class HttpTransport::ApiError
Raised for non-success HTTP responses, carrying the status and body.
Attributes
Public Class Methods
Source
# File app/services/http_transport.rb, line 19 def initialize(status, response_body) @status = status @response_body = response_body super("HTTP #{status}#{server_message(response_body)}") end
Creates the error with the HTTP status and response body. The message surfaces the server’s own error.message when the body is JSON — e.g. a Nessie “No default-warehouse configured” that a bare “HTTP 500” would otherwise hide.
@param status [Integer] the HTTP status code @param response_body [String, nil] the response body
Calls superclass method