Skip to content

Commit

Permalink
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/src/main/java/org/jruby/RubyThread.java
Original file line number Diff line number Diff line change
@@ -258,7 +258,14 @@ private void executeInterrupts(ThreadContext context, boolean blockingTiming) {
if (status.get() == Status.SLEEP) {
exitSleep();
}
RubyKernel.raise(context, runtime.getKernel(), new IRubyObject[]{err, RubyHash.newKwargs(runtime, "cause", ((RubyException) err).cause)}, Block.NULL_BLOCK);
// if it's a Ruby exception, force the cause through
IRubyObject[] args;
if (err instanceof RubyException) {
args = Helpers.arrayOf(err, RubyHash.newKwargs(runtime, "cause", ((RubyException) err).cause));
} else {
args = Helpers.arrayOf(err);
}
RubyKernel.raise(context, runtime.getKernel(), args, Block.NULL_BLOCK);
}
}

0 comments on commit 8d3b9aa

Please sign in to comment.