From: "Iñaki Baz Castillo" Date: 2012-05-17T07:45:32+09:00 Subject: Re: Which exception classes does "rescue" trap? 2012/5/17 Henry Maddocks : > > On 17/05/2012, at 9:59 AM, Iñaki Baz Castillo wrote: > >> Hi, using Ruby 1.9 I've realized that "rescue" traps more than >> StandardError exceptions, for example NoMemoryError: > > > Not for me it doesn't. My fault, sorry, I did a wrong code. >> But for example it does not trap ScriptError exceptions. So which >> exact exception classes does "rescue" trap? is it docummented >> somewhere? Unfortunately I am not able to find in Ruby sources where >> the definition of "rescue" is. > > Google is your friend... > > http://jpablobr.com/past/ruby-s-exception-hierarchy > > Rescuing an Exception class will also rescue it's sub-classes. This doesn't work work for modules though, which would be really handy. Yes sure :) My question is, however: does "rescue" trap any exception class not inheriting from StandardError? But don't worry, I'm coding some script right now to discover it :) Thanks a lot. -- Iñaki Baz Castillo