Class: Hanami::Router::NotFoundError
- Inherits:
-
Error
- Object
- Error
- Hanami::Router::NotFoundError
- Defined in:
- lib/hanami/extensions/router/errors.rb
Overview
Error raised when a request is made for a missing route.
Raised only when using hanami-router as part of a full Hanami app. When using hanami-router standalone, the behavior for such requests is to return a “Not Found” response.
Instance Attribute Summary collapse
-
#env ⇒ Hash
readonly
The Rack environment for the request.
Instance Method Summary collapse
-
#initialize(env) ⇒ NotFoundError
constructor
A new instance of NotFoundError.
Constructor Details
#initialize(env) ⇒ NotFoundError
Returns a new instance of NotFoundError.
21 22 23 24 25 26 |
# File 'lib/hanami/extensions/router/errors.rb', line 21 def initialize(env) @env = env = "No route found for #{env["REQUEST_METHOD"]} #{env["PATH_INFO"]}" super() end |
Instance Attribute Details
#env ⇒ Hash (readonly)
Returns the Rack environment for the request.
19 20 21 |
# File 'lib/hanami/extensions/router/errors.rb', line 19 def env @env end |