Skip to content

Commit

Permalink
clear mrb->exc after run code.
Browse files Browse the repository at this point in the history
  • Loading branch information
tokuhirom committed Sep 18, 2012
1 parent b49e3d0 commit 2355a9c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/node-mruby.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ class NodeMRuby : ObjectWrap {
if (MRB_->exc) {
mrb_value val = mrb_obj_value(MRB_->exc);
mrb_p(MRB_, val);
MRB_->exc = 0; // clear error
// TODO: better diag
return ThrowException(Exception::Error(String::New("Got a ruby level exception")));
// return ThrowException(mrubyobj2js(args.This(), val));
Expand Down Expand Up @@ -370,6 +371,7 @@ class NodeMRuby : ObjectWrap {
DBG("--- Got mruby level exception in loadFile");
mrb_value val = mrb_obj_value(MRB_->exc);
mrb_p(MRB_, val);
MRB_->exc = 0; // clear error
// return ThrowException(mrubyobj2js(args.This(), val));
// TODO: better exception
return ThrowException(Exception::Error(String::New("Caused ruby level exception")));
Expand Down

0 comments on commit 2355a9c

Please sign in to comment.