Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10079 (closed enhancement: fixed)

Opened 7 months ago

Last modified 7 months ago

[PATCH] Enhanced rescue_from

Reported by: fxn Assigned to: core
Priority: normal Milestone: 2.x
Component: ActionPack Version: edge
Severity: normal Keywords: rescue_from exception
Cc:

Description

The current implementation of rescue_from uses a hash table of class names. When an exception is raised there's a table lookup by class name.

In consequence, inheritance of exceptions (useful for catchalls) is not taken into account, nor the controllers hierarchy. Handlers can't reliably take over the exceptions of previously declared handlers, .... This patch provides those features and additionally allows strings in rescue_from declarations instead of constants. This way you may define a handler for an exception whose definition has not yet been executed.

Attachments

enhanced_rescue_from.diff (11.4 kB) - added by fxn on 11/05/07 22:18:28.

Change History

11/05/07 22:18:28 changed by fxn

  • attachment enhanced_rescue_from.diff added.

11/06/07 06:02:28 changed by nzkoz

  • status changed from new to closed.
  • resolution set to fixed.

(In [8081]) Make rescue_from behave like rescue when dealing with subclasses. Closes #10079 [fxn]