[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Why this exception is not caught?

Rick DeNatale

9/11/2006 8:56:00 PM

On 9/11/06, Hemant . <inxs.hemant@gmail.com> wrote:

> In this case, when the exception is raised on line # 94, then in the calling
> method...it is handled as general rescue...and its not handled as Exception
> of Class RetryException.However, if i remove the last rescue statement in
> the second method it works alright.

Because that second rescue statement catches any exception which is a
subclass of StandardError, so it catches the RetryException.

Then the statement

raise "some other error"

raises a RunTimeError with "some other error" as a message.

So the outer method sees the RunTimeError and not the original RetryException.
--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denh...