mirror of https://github.com/rails/rails
Merge pull request #19610 from yui-knk/fix/suppress
[ci skip] Replace `reraised` with `not captured`
This commit is contained in:
commit
c91581ffee
|
@ -475,7 +475,7 @@ The methods `silence_warnings` and `enable_warnings` change the value of `$VERBO
|
||||||
silence_warnings { Object.const_set "RAILS_DEFAULT_LOGGER", logger }
|
silence_warnings { Object.const_set "RAILS_DEFAULT_LOGGER", logger }
|
||||||
```
|
```
|
||||||
|
|
||||||
Silencing exceptions is also possible with `suppress`. This method receives an arbitrary number of exception classes. If an exception is raised during the execution of the block and is `kind_of?` any of the arguments, `suppress` captures it and returns silently. Otherwise the exception is reraised:
|
Silencing exceptions is also possible with `suppress`. This method receives an arbitrary number of exception classes. If an exception is raised during the execution of the block and is `kind_of?` any of the arguments, `suppress` captures it and returns silently. Otherwise the exception is not captured:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
# If the user is locked, the increment is lost, no big deal.
|
# If the user is locked, the increment is lost, no big deal.
|
||||||
|
|
Loading…
Reference in New Issue