aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/rescuable.rb
Commit message (Collapse)AuthorAgeFilesLines
* Privatize unneededly protected methods in Active SupportAkira Matsuda2016-12-241-1/+1
|
* Refactor the handling of fallback exception handlersSean Griffin2016-11-171-10/+5
|
* Call fallback exception handlers with the right exceptionSean Griffin2016-11-171-3/+10
| | | | | | | | The issue presented in #26246 showed a deeper underlying problem. When we fell back to the exception handler for an exceptions cause, we were calling that handler with the outer raised exception. This breaks the calling code's expectations, especially if the exception has methods on it behond those from `StandardError`.
* Add missing `+` around a some literals.bogdanvlviv2016-10-271-2/+2
| | | | | | Mainly around `nil` [ci skip]
* applies new string literal convention in activesupport/libXavier Noria2016-08-061-4/+4
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Action Mailer: Declarative exception handling with `rescue_from`.Jeremy Daer2016-05-151-53/+89
| | | | | | | | | | | | | | | | | | | | | | | Follows the same pattern as controllers and jobs. Exceptions raised in delivery jobs (enqueued by `#deliver_later`) are also delegated to the mailer's rescue_from handlers, so you can handle the DeserializationError raised by delivery jobs: ```ruby class MyMailer < ApplicationMailer rescue_from ActiveJob::DeserializationError do … end ``` ActiveSupport::Rescuable polish: * Add the `rescue_with_handler` class method so exceptions may be handled at the class level without requiring an instance. * Rationalize `exception.cause` handling. If no handler matches the exception, fall back to the handler that matches its cause. * Handle exceptions raised elsewhere. Pass `object: …` to execute the `rescue_from` handler (e.g. a method call or a block to instance_exec) against a different object. Defaults to `self`.
* Use the most highest priority exception handler when cause is setSean Griffin2016-03-111-0/+10
| | | | | | | | | | | | There was some subtle breakage caused by #18774, when we removed `#original_exception` in favor of `#cause`. However, `#cause` is automatically set by Ruby when raising an exception from a rescue block. With this change, we will use whichever handler has the highest priority (whichever call to `rescue_from` came last). In cases where the outer has lower precidence than the cause, but the outer is what should be handled, cause will need to be explicitly unset. Fixes #23925
* [ci skip] Update ActiveSupport::Rails and ActiveSupport::Rescuable docsDAVID MOORE2015-04-261-1/+1
| | | | [Dave Moore]
* Wrap inline rescue with or-equal callsRobin Dupret2015-03-021-1/+1
| | | | | At the moment, `rescue_from` doesn't work with strings on Rubinius because of rubinius/rubinius#3272.
* Add class level case operator support for error dispatching in RescuableGenadi Samokovarov2014-12-101-2/+2
|
* Remove deprecated `Proc#bind` with no replacement.Carlos Antonio da Silva2013-07-011-1/+0
|
* update some AS code examples to 1.9 hash syntax [ci skip]Francesco Rodriguez2012-09-121-3/+3
|
* Document exception handling inside resce_from handlerstwinturbo2012-04-281-0/+1
|
* removed warning: shadowing outer local variable - exceptionArun Agrawal2012-03-241-1/+1
|
* Fix tests, when creating rescue handler, we need to check for arity nowPiotr Sarnacki2012-03-231-1/+5
| | | | | | Before it was handled by Proc.bind, but since Proc.bind has been deprecated, this is no longer the case and returned handler needs to match rescuer.
* deprecate Proc#bind that can cause symbol memory leakSergey Nartimov2012-03-221-1/+1
|
* Whitespace and example identationJosep M. Bach2010-08-151-0/+1
|
* add missing requires to Rescuable and RouteSet [#4415 state:committed]Mislav Marohnić2010-04-161-0/+1
| | | | Signed-off-by: Xavier Noria <fxn@hashref.com>
* Convert to class_attributeJeremy Kemper2010-02-011-4/+4
|
* rescuable.rb needs active_support/core_ext/array/extract_optionsXavier Noria2010-01-011-0/+1
|
* rescuable.rb needs active_support/core_ext/string/inflections because it ↵Xavier Noria2010-01-011-0/+1
| | | | uses constantize
* Rescue handlers should never need array wrapping. Bug if so.Jeremy Kemper2009-11-131-2/+1
|
* Prefer Array.wrap to Array()Jeremy Kemper2009-11-131-1/+2
|
* Extend Callbacks and Rescuable with AS concernJoshua Peek2009-10-131-4/+4
|
* Explicit dependency on Proc#bind extensionJeremy Kemper2009-03-281-0/+1
|
* Explicit dependency on class_inheritable_accessorJeremy Kemper2009-03-241-0/+2
|
* Don't shadow local with black argJeremy Kemper2008-11-071-4/+4
|
* Add tests for ActiveSupport::Rescuable. Use ActiveSupport::Rescuable in ↵Pratik Naik2008-10-041-20/+54
| | | | ActionController::Base.
* First draft of ActiveSupport::RescuableNorbert Crombach2008-10-041-0/+74
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>