Exception: Mack::Errors::UnsuccessfulRenderUrl

Inherits:
StandardError
  • Object
show all
Defined in:
lib/mack/errors/errors.rb

Overview

Potentially raised if a render(:url, “.…”) is a status other than 200. This is only raised if :raise_exception is passed in as true to the render options.

Instance Method Summary collapse

Constructor Details

#initialize(uri, response) ⇒ UnsuccessfulRenderUrl

Takes the uri trying to be rendered the Net::HTTP response object.



95
96
97
98
99
# File 'lib/mack/errors/errors.rb', line 95

def initialize(uri, response)
  code = response.code if response.respond_to?(:code)
  code = response.status if response.respond_to?(:status)
  super("URI: #{uri}; status: #{code}")
end