Class: Frenetic::ResourceNotFound
- Inherits:
-
ClientError
- Object
- Frenetic::ResourceNotFound
- Defined in:
- lib/frenetic/errors.rb
Overview
Raise when a network reponse returns a 404 Not Found error
Instance Method Summary collapse
-
#initialize(resource, params) ⇒ ResourceNotFound
constructor
A new instance of ResourceNotFound.
- #message ⇒ Object
Constructor Details
#initialize(resource, params) ⇒ ResourceNotFound
Returns a new instance of ResourceNotFound.
151 152 153 154 155 156 |
# File 'lib/frenetic/errors.rb', line 151 def initialize(resource, params) @resource = resource.to_s.demodulize @params = params @status = 404 super() end |
Instance Method Details
#message ⇒ Object
158 159 160 161 162 163 164 |
# File 'lib/frenetic/errors.rb', line 158 def if @params.blank? "Couldn't find #{@resource} without an ID" else "Couldn't find #{@resource} with #{stringified_params}" end end |