1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Remove documentation that fatal cannot be rescued [ci skip]

You can rescue it:

f = ObjectSpace.each_object(Class){|c| break c if c.name == 'fatal'}
begin
  raise f
rescue f
  2
end # => 2

It's not a good idea to rescue fatal exceptions you didn't generate
yourself, though.

Fixes [Bug #10691]
This commit is contained in:
Jeremy Evans 2019-08-11 19:42:59 -07:00
parent 3979f22cc1
commit 404850e134

View file

@ -2360,7 +2360,7 @@ syserr_eqq(VALUE self, VALUE exc)
* Document-class: fatal
*
* fatal is an Exception that is raised when Ruby has encountered a fatal
* error and must exit. You are not able to rescue fatal.
* error and must exit.
*/
/*