Hi, At Thu, 15 Sep 2005 14:57:22 +0900, Joel VanderWerf wrote in [ruby-talk:156196]: > Now, here's another option, but is there anything wrong with it? > > module NetworkRaisable; end > class Errno::EPROTO; include NetworkRaisable; end > class Errno::ECONNREFUSED; include NetworkRaisable; end > # and so on > > begin > raise Errno::ECONNREFUSED > rescue NetworkRaisable > puts "OK!" > end Actually, an exception, to be caught, doesn't have to be including target module always. module NetworkRaisable def self.===(ex) case ex when Errno::EPROTO, Errno::ECONNREFUSED: true end end end -- Nobu Nakada