class Parliament::ClientError

An error raised when a 4xx status code is returned by Net::HTTP inside of Parliament::Request.

@see Parliament::ServerError

@since 0.6.0

Public Class Methods

new(url, response) click to toggle source

@param [String] url the url that caused the Parliament::ClientError @param [Net::HTTPClientError] response the Net:HTTPClientError that caused the Parliament::ClientError

@example Creating a Parliament::ClientError

url = 'http://localhost:3030/foo/bar'

response = Net::HTTP.get_response(URI(url))

raise Parliament::ClientError.new(url, response) if response.is_a?(Net::HTTPClientError)
Calls superclass method Parliament::NetworkError::new
# File lib/parliament/client_error.rb, line 17
def initialize(url, response)
  super
end