1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Move the rescue_from API docs link to the first mention of it

in the Action Cable Overview guide

If we want to link to the `rescue_from` API docs, it makes more sense to
do it the first time we mention `rescue_from` rather than the second
time.

[ci skip]
This commit is contained in:
Richard Macklin 2020-03-20 16:59:23 -07:00
parent 26478224ce
commit 0c3f3202fd

View file

@ -132,7 +132,8 @@ verified_user = User.find_by(id: cookies.encrypted['_session']['user_id'])
By default, unhandled exceptions are caught and logged to Rails' logger. If you would like to
globally intercept these exceptions and report them to an external bug tracking service, for
example, you can do so with `rescue_from`.
example, you can do so with
[`rescue_from`](https://api.rubyonrails.org/classes/ActiveSupport/Rescuable/ClassMethods.html#method-i-rescue_from).
```ruby
# app/channels/application_cable/connection.rb
@ -198,9 +199,8 @@ end
#### Exception Handling
As with `ActionCable::Connection::Base`, you can also use
[`rescue_from`](https://api.rubyonrails.org/classes/ActiveSupport/Rescuable/ClassMethods.html)
on a specific channel to handle raised exceptions:
As with `ActionCable::Connection::Base`, you can also use `rescue_from` on a
specific channel to handle raised exceptions:
```ruby
# app/channels/chat_channel.rb