I
Iñaki Baz Castillo
Hi, I read in this article:
http://jerith.livejournal.com/40063.html
that:
=2D--------------------------
Exception
- StandardError
- RuntimeError
- ZeroDivisionError
- ScriptError
- SyntaxError
- SystemExit
- SignalException
- Interrupt
The important bit there is that all the stuff you can reasonably expect to=
=20
recover from is under StandardError. Because of this, a default rescue bloc=
k=20
will not catch anything that isn't a StandardError. The observant reader wi=
ll=20
notice that I helpfully showed Interrupt's position in the hierarchy. The=20
observant reader will also notice that it is not a subclass of StandardErro=
r.=20
This means that you need to catch it explicitly, or it will cause a crash.
=2D--------------------------
But is it really true? I do:
=2D---
begin
raise Interrupt
rescue
puts "rescued !!!"
end
=2D---
And I get:
=3D> "rescued !!!"
So is the above article tru or not?
Thanks.
=2D-=20
I=C3=B1aki Baz Castillo
http://jerith.livejournal.com/40063.html
that:
=2D--------------------------
Exception
- StandardError
- RuntimeError
- ZeroDivisionError
- ScriptError
- SyntaxError
- SystemExit
- SignalException
- Interrupt
The important bit there is that all the stuff you can reasonably expect to=
=20
recover from is under StandardError. Because of this, a default rescue bloc=
k=20
will not catch anything that isn't a StandardError. The observant reader wi=
ll=20
notice that I helpfully showed Interrupt's position in the hierarchy. The=20
observant reader will also notice that it is not a subclass of StandardErro=
r.=20
This means that you need to catch it explicitly, or it will cause a crash.
=2D--------------------------
But is it really true? I do:
=2D---
begin
raise Interrupt
rescue
puts "rescued !!!"
end
=2D---
And I get:
=3D> "rescued !!!"
So is the above article tru or not?
Thanks.
=2D-=20
I=C3=B1aki Baz Castillo