From: lasitha Date: 2009-03-03T14:13:21+09:00 Subject: Re: Using inline "rescue" with error class On Tue, Mar 3, 2009 at 5:58 AM, Iñaki Baz Castillo wrote: > I would like to just write: >  IPAddr.new(value) rescue ArgumentError puts "Invalid IP" > > Unfortunatelly it doesn't work when the rescue action occurs: > ------------ > Invalid IP > NoMethodError: undefined method `ArgumentError' for main:Object > ------------ > The rescue statement modifier doesn't take an exception parameter. You'd have to make do with: IPAddr.new(value) rescue puts "Invalid IP" This of course makes the construct much less appealing. There has been a very recent thread related to this. Solidarity, lasitha