summaryrefslogtreecommitdiffhomepage
path: root/src/error.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-01-12 15:29:02 +0900
committerGitHub <[email protected]>2017-01-12 15:29:02 +0900
commitfb1dad82aae8c98949be7e5ad7440675c67265bb (patch)
treea53503ae7b868ca71399367f88c8c7407da1ba64 /src/error.c
parenta69d92e8197dc10b29387fd1e1272db13bdca0f5 (diff)
parent6be5160eb634e7b045cba83a38675cf14fa16593 (diff)
downloadmruby-fb1dad82aae8c98949be7e5ad7440675c67265bb.tar.gz
mruby-fb1dad82aae8c98949be7e5ad7440675c67265bb.zip
Merge pull request #3394 from clayton-shopify/really-fix-nme
Fix 36fc1f14 not checking in the right location
Diffstat (limited to 'src/error.c')
-rw-r--r--src/error.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/error.c b/src/error.c
index fda2cd15c..d7facd0b9 100644
--- a/src/error.c
+++ b/src/error.c
@@ -280,8 +280,6 @@ mrb_exc_set(mrb_state *mrb, mrb_value exc)
mrb->exc = 0;
}
else {
- if (!mrb_obj_is_kind_of(mrb, exc, mrb->eException_class))
- mrb_raise(mrb, E_TYPE_ERROR, "exception object expected");
mrb->exc = mrb_obj_ptr(exc);
}
}
@@ -289,6 +287,9 @@ mrb_exc_set(mrb_state *mrb, mrb_value exc)
MRB_API mrb_noreturn void
mrb_exc_raise(mrb_state *mrb, mrb_value exc)
{
+ if (!mrb_obj_is_kind_of(mrb, exc, mrb->eException_class)) {
+ mrb_raise(mrb, E_TYPE_ERROR, "exception object expected");
+ }
mrb_exc_set(mrb, exc);
if (!mrb->gc.out_of_memory) {
exc_debug_info(mrb, mrb->exc);