Skip to content

Commit 56771e2

Browse files
dblockprzbadu
authored andcommittedApr 5, 2016
Documented changes in ruby-grape#1283 wrt handling of Grape::Exceptions::MethodNotAllowed. [ci skip]
1 parent 6751777 commit 56771e2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

‎UPGRADING.md

+12
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,18 @@ See [#1285](https://github.com/ruby-grape/grape/pull/1285) for more information.
4242

4343
Using `route :any, '*path'` no longer blocks generated `OPTIONS` and Method Not Allowed methods from other routes. Use `do_not_route_options!` to prevent `OPTIONS` routes from being created.
4444

45+
See [#1263](https://github.com/ruby-grape/grape/pull/1263) for more information.
46+
47+
Furthermore, a `405 Method Not Allowed` error now causes `Grape::Exceptions::MethodNotAllowed` to be raised, which will be rescued via `rescue_from :all`. Restore old behavior with the following error handler.
48+
49+
```ruby
50+
rescue_from Grape::Exceptions::Base do |e|
51+
error! e.message, e.status, e.headers
52+
end
53+
```
54+
55+
See [#1283](https://github.com/ruby-grape/grape/pull/1283) for more information.
56+
4557
### Upgrading to >= 0.14.0
4658

4759
#### Changes to availability of DSL methods in filters

0 commit comments

Comments
 (0)