Exception: Parliament::NoContentResponseError

Inherits:
NetworkError
  • Object
show all
Defined in:
lib/parliament/no_content_response_error.rb

Overview

An error raised when an empty response is returned by Net::HTTP inside of Parliament::Request.

Since:

  • 0.6.0

Instance Method Summary collapse

Constructor Details

#initialize(url, response) ⇒ NoContentResponseError

Returns a new instance of NoContentResponseError.

Examples:

Creating a Parliament::NoContentResponseError

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

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

raise Parliament::NoContentResponseError.new(url, response) if response.body.nil?

Parameters:

  • url (String)

    the url that caused the Parliament::ClientError

  • response (Net::HTTPResponse)

    the Net:HTTPResponse that caused the Parliament::NoContentResponseError

Since:

  • 0.6.0



15
16
17
# File 'lib/parliament/no_content_response_error.rb', line 15

def initialize(url, response)
  super
end