From: "Iñaki Baz Castillo" Date: 2008-07-23T09:28:54+09:00 Subject: How to do group Exception classes? Hi, I've some exception that I want to group into "AuthError" class so I can do a "raise" for the specific child exception or for the parent class. Is the following correct? --------------------------- module Auth class GenericError < StandardError end class WrongPassword < GenericError end class ExpiredAccount < GenericError end end ---------------------------- so now I can do: ---------------------------- begin raise Auth::WrongPassword rescue Auth::GenericError => e puts "Exception class rescued: #{e.class}" end => Exception class rescued: Auth::WrongPassword ---------------------------- This is: I didn't do a "rescue" for Auth::WrongPassword, but for Auth::GenericError. But since Auth::WrongPassword is a child of Auth::GenericError then the rescue is executed and "e" is Auth::WrongPassword. Do you suggest a better way of doing it? Thanks a lot for any suggestion. -- Iñaki Baz Castillo