diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-10 13:16:33 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-10 13:16:33 +0000 |
commit | b050cc5ab9b0774bbd16f49f4787f50b07c566fe (patch) | |
tree | 959cb4adedf0859ee1979938bb95e27c81a80bba /eval.c | |
parent | 2fff948394f1baab5bc97aca5ceab81b087c4bc4 (diff) | |
download | ruby-b050cc5ab9b0774bbd16f49f4787f50b07c566fe.tar.gz |
error.c: Exception#cause
* error.c (exc_cause): captured previous exception.
* eval.c (make_exception): capture previous exception automagically.
[Feature #8257]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -641,6 +641,10 @@ make_exception(int argc, VALUE *argv, int isstr) if (argc > 2) set_backtrace(mesg, argv[2]); } + { + VALUE cause = get_errinfo(); + if (!NIL_P(cause)) rb_iv_set(mesg, "cause", cause); + } return mesg; } |