Exception: Parliament::ClientError

Inherits:
NetworkError show all
Defined in:
lib/parliament/client_error.rb

Overview

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

See Also:

Since:

  • 0.6.0

Instance Method Summary collapse

Constructor Details

#initialize(url, response) ⇒ ClientError

Returns a new instance of ClientError.

Examples:

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)

Parameters:

  • url (String)

    the url that caused the Parliament::ClientError

  • response (Net::HTTPClientError)

    the Net:HTTPClientError that caused the Parliament::ClientError

Since:

  • 0.6.0



17
18
19
# File 'lib/parliament/client_error.rb', line 17

def initialize(url, response)
  super
end