Skip to content

Commit f5afc1a

Browse files
author
Alec Clarke
committed
Clarify use of rescue_from [ci skip]
`rescue_from` works for rescuing exceptions in controller actions, but it's not specific to ActionController. This change updates the docs to clarify the specifics of how `rescue_from` is used and that its use goes beyond controller actions. Note: I believe the original addition of this documentation was added as part of the move from [`ActionController::Rescue` to `ActiveSupport::Rescuable`](rails@259a7a8#diff-2276a3674b84e1262c94cc36346f9fbd8d00e0a4542bb991a8846c06d86335b1R12)
1 parent 35ecdf0 commit f5afc1a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

activesupport/lib/active_support/rescuable.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ module Rescuable
1414
end
1515

1616
module ClassMethods
17-
# Rescue exceptions raised in controller actions.
17+
# Registers exception classes with a handler to be called by <tt>rescue_with_handler</tt>.
1818
#
1919
# <tt>rescue_from</tt> receives a series of exception classes or class
20-
# names, and a trailing <tt>:with</tt> option with the name of a method
21-
# or a Proc object to be called to handle them. Alternatively a block can
22-
# be given.
20+
# names, and an exception handler specified by a trailing <tt>:with</tt>
21+
# option containing the name of a method or a Proc object. Alternatively, a block
22+
# can be given as the handler.
2323
#
2424
# Handlers that take one argument will be called with the exception, so
2525
# that the exception can be inspected when dealing with it.

0 commit comments

Comments
 (0)