I
Iñaki Baz Castillo
Hi, instead of:
=2D---------
begin
IPAddr.new(value)
rescue ArgumentError
puts "Invalid IP"
end
=2D---------
I would like to just write:
IPAddr.new(value) rescue ArgumentError puts "Invalid IP"
Unfortunatelly it doesn't work when the rescue action occurs:
=2D-----------
Invalid IP
NoMethodError: undefined method `ArgumentError' for main:Object
=2D-----------
Do I miss some way to set the error class when using inline rescue?
Thanks a lot.
=2D-=20
I=C3=B1aki Baz Castillo
=2D---------
begin
IPAddr.new(value)
rescue ArgumentError
puts "Invalid IP"
end
=2D---------
I would like to just write:
IPAddr.new(value) rescue ArgumentError puts "Invalid IP"
Unfortunatelly it doesn't work when the rescue action occurs:
=2D-----------
Invalid IP
NoMethodError: undefined method `ArgumentError' for main:Object
=2D-----------
Do I miss some way to set the error class when using inline rescue?
Thanks a lot.
=2D-=20
I=C3=B1aki Baz Castillo