Mention show_exception :after-handler option

error handler blocks won't run in development unless users set that
option
This commit is contained in:
Washington Luiz 2014-06-19 09:25:21 -03:00
parent f02c7a0fe3
commit c5bbb944bc
1 changed files with 8 additions and 2 deletions

View File

@ -2308,8 +2308,14 @@ end
### Error
The `error` handler is invoked any time an exception is raised from a route
block or a filter. The exception object can be obtained from the
`sinatra.error` Rack variable:
block or a filter. But note in development it will only run if you set the
show exceptions option to `:after_handler`.
```ruby
set :show_exceptions, :after_handler
```
The exception object can be obtained from the `sinatra.error` Rack variable.
``` ruby
error do