You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@
10
10
11
11
* Your contribution here.
12
12
*[#1737](https://github.com/ruby-grape/grape/pull/1737): Fix translating error when passing symbols as params in custom validations - [@mlzhuyi](https://github.com/mlzhuyi).
13
+
*[]: Rescue truly all exceptions - [@mtsmfm](https://github.com/mtsmfm).
Copy file name to clipboardExpand all lines: README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -2071,7 +2071,7 @@ literally accepts every request.
2071
2071
2072
2072
## Exception Handling
2073
2073
2074
-
Grape can be told to rescue all `StandardError`exceptions and return them in the API format.
2074
+
Grape can be told to rescue all exceptions and return them in the API format.
2075
2075
2076
2076
```ruby
2077
2077
classTwitter::API < Grape::API
@@ -2098,7 +2098,7 @@ class Twitter::API < Grape::API
2098
2098
end
2099
2099
```
2100
2100
2101
-
In this case ```UserDefinedError```must be inherited from ```StandardError```.
2101
+
```UserDefinedError```can be inherited from any exception class.
2102
2102
2103
2103
Notice that you could combine these two approaches (rescuing custom errors takes precedence). For example, it's useful for handling all exceptions except Grape validation errors.
0 commit comments