From: Intransition Date: 2010-02-14T09:21:14+09:00 Subject: Re: Q: will this always work: rescuing with non-Exception classes On Feb 13, 6:45 pm, Jeremy Henty wrote: > I wondered  whether the  clause rescue would  accept any  modules, not > just exception classes.  Well, at least in MRI 1.8.7, it does (example > appended).  But will this work in all Ruby implementations? > > Regards, > > Jeremy Henty > > Example (prints "Rescued!") > >     module MyModule >     end > >     class MyException < StandardError >       include MyModule >     end > >     begin >       raise MyException >     rescue MyModule >       puts 'Rescued!' >     end That's interesting. If it is using #=== to determine this then it should.