added section about Kemal.config.always_rescue (#22)

This commit is contained in:
Henrik Christensen 2021-10-04 08:28:13 +02:00 committed by GitHub
parent d0cf79de3e
commit 97733e57c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -62,6 +62,13 @@ describe "Your::Kemal::App" do
end end
``` ```
#### Rescue errors
Errors gets rescued by default which results in the Kemal's exception page is rendered.
This may not always be the desired behaviour, e.g. when a JSON parsing error occurs one might expect `"[]"`
and not Kemal's exception page.
Set `Kemal.config.always_rescue = false` to prevent this behaviour and raise errors instead.
## Contributing ## Contributing
1. Fork it ( https://github.com/kemalcr/spec-kemal/fork ) 1. Fork it ( https://github.com/kemalcr/spec-kemal/fork )