From: Robert Klemme Date: 2004-07-05T16:37:41+09:00 Subject: Re: Exceptions list - Unix ENOENT not the name of the exception - what is? "Lennon Day-Reynolds" schrieb im Newsbeitrag news:5d4c6124040702163941cbd3c7@mail.gmail.com... > On Fri, 2 Jul 2004 23:32:47 +0900, Robert Klemme wrote: > [...] > > In this case catching Exception should have helped, too. Or am I missing > > something? > > > > begin > > File.open("not possibly found here") > > rescue Exception => e > > p e > > puts e.class > > end > > This will work, but catch-all rescue blocks like that can be > dangerous, as they can mask user interrupts, missing method errors, > etc. Using the most specific exception class that still covers the > errors you expect to see in a block means that unexpected errors will > be thrown up to higher levels on the stack, which is exactly what > should happen. Of course you are right, but this code snippet was just meant to determine the proper type. I was responding to another suggestion how to find the type of this exception. This was not meant to be program code. Regards robert