Exception: Parliament::ServerError

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

Overview

An error raised when a 5xx 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) ⇒ ServerError

Returns a new instance of ServerError.

Examples:

Creating a Parliament::ServerError

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

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

raise Parliament::ServerError.new(url, response) if response.is_a?(Net::HTTPServerError)

Parameters:

  • url (String)

    the url that caused the Parliament::ServerError

  • response (Net::HTTPServerError)

    the Net:HTTPServerError that caused the Parliament::ServerError

Since:

  • 0.6.0



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

def initialize(url, response)
  super
end