【发布时间】:2011-03-14 02:32:10
【问题描述】:
在红宝石中,
begin
# ...
rescue
# ...
end
不会捕获不是StandardError 子类的异常。在 C 语言中,
rb_rescue(x, Qnil, y, Qnil);
VALUE x(void) { /* ... */ return Qnil; }
VALUE y(void) { /* ... */ return Qnil; }
会做同样的事情。如何从 ruby C 扩展中rescue Exception => e(而不仅仅是rescue => e)?
【问题讨论】:
标签: c ruby exception-handling ruby-c-extension rescue