class Parliament::ServerError

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

@see Parliament::ClientError

@since 0.6.0

Public Class Methods

new(url, response) click to toggle source

@param [String] url the url that caused the Parliament::ServerError @param [Net::HTTPServerError] response the Net:HTTPServerError that caused the Parliament::ServerError

@example 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)
Calls superclass method Parliament::NetworkError::new
# File lib/parliament/server_error.rb, line 17
def initialize(url, response)
  super
end