Jeffrey Moss wrote: > rescue Exception > > All exceptions descend from class Exception. > > -Jeff > > On Fri, Dec 09, 2005 at 04:12:35AM +0900, William E. Rubin wrote: >> Is there a way to rescue any raised error? Like "rescue *" or >> something? >> >> The "Programming Ruby" book on ruby-lang.org says that just plain >> "rescue" (without a parameter list) will rescue any "StandardError", >> but it doesn't go on to say that anything raised is necessarily >> descended from StandardError, or to explicitly mention a way to rescue >> everything. >> >> I was guessing that just plain "rescue" might work, but this doesn't >> seem to be true - my code just got a "Timeout::Error", and it was not >> rescued by a parameterless "rescue". >> >> Thanks. >> >> I actually think that's kinda non-rubyish. Why not simply require objects to have the basic methods of an exception (`exception', and maybe `message', `backtrace', etc.) to qualify as an exception? class FooException attr_reader :message def initialize(message) @message = message end def exception(message = nil) if message.nil? return self else self.new(message) end end end Cheers, Daniel