Forum: Ruby Error handling and recovery

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
24c6e4ed08f7a4bf9cfb7edc2dbd14b8?d=identicon&s=25 Patrick Spence (pkspence)
on 2006-05-30 14: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!
3807680355002d0d5e8314a97333587e?d=identicon&s=25 Nikolai Weibull (Guest)
on 2006-05-30 15:43
(Received via mailing list)
On 5/30/06, Patrick Spence <patrick@pkspence.com> 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.

Peace.

  nikolai
This topic is locked and can not be replied to.