Forum: Ruby Error handling and recovery

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Patrick S. (Guest)
on 2006-05-30 16:34
I have a module which specifically deals with connections to a MSSQL
database. Contained in this module is a method which actually opens the
connection. The code contained in the method is wrapped w/in a
begin...rescue...end block. If any sort of an error occurs, the code in
the rescue block is supposed to to re-raise the error back to the
calling module and let it deal with error reporting/recovery. The
problem is that the code in the rescue block of the module that's
calling the method to open the connection is not running. I'd understood
that Ruby would search back thru the callstack looking for a rescue
block when an error was raised. Obviously I'm missing something here!
Nikolai W. (Guest)
on 2006-05-30 17:43
(Received via mailing list)
On 5/30/06, Patrick S. <removed_email_address@domain.invalid> wrote:
[Error not being re-raised]
> Obviously I'm missing something here!

And we're missing some code.  Code makes it a lot easier to understand
what you're doing, how you're doing it, and what you're doing wrong.


This topic is locked and can not be replied to.