Skip to content

Commit

Permalink
Do not insert cause into exception if it's the same as exception.
Browse files Browse the repository at this point in the history
Fixes #4114.
  • Loading branch information
headius committed Sep 30, 2016
1 parent 895e1f4 commit 9fced1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyKernel.java
Expand Up @@ -865,7 +865,7 @@ public static IRubyObject raise(ThreadContext context, IRubyObject recv, IRubyOb
printExceptionSummary(context, runtime, raise.getException());
}

if (argc > 0 && raise.getException().getCause() == UNDEF) {
if (argc > 0 && raise.getException().getCause() == UNDEF && cause != raise.getException()) {
raise.getException().setCause(cause);
}

Expand Down

0 comments on commit 9fced1e

Please sign in to comment.