From 47851718eb46963f27e3d5d346d0348b8b8e7b5c Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Wed, 15 Oct 2014 06:27:43 +0200 Subject: [PATCH] MRI: Handle exceptions raised in preloaded scripts --- binding-mri/binding-mri.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/binding-mri/binding-mri.cpp b/binding-mri/binding-mri.cpp index b8d4445..6fccdd5 100644 --- a/binding-mri/binding-mri.cpp +++ b/binding-mri/binding-mri.cpp @@ -437,6 +437,10 @@ static void runRMXPScripts(BacktraceData &btData) for (size_t i = 0; i < conf.preloadScripts.size(); ++i) runCustomScript(conf.preloadScripts[i]); + VALUE exc = rb_gv_get("$!"); + if (exc != Qnil) + return; + while (true) { for (long i = 0; i < scriptCount; ++i)