Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: bf4b9c7bd578
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 34bec6e62e53
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Apr 12, 2018

  1. Copy the full SHA
    3e3dae5 View commit details
  2. Merge pull request #5136 from ujihisa/master

    Support overriding `Exception#message`
    headius authored Apr 12, 2018
    Copy the full SHA
    34bec6e View commit details
Showing with 7 additions and 2 deletions.
  1. +7 −2 core/src/main/java/org/jruby/runtime/backtrace/TraceType.java
9 changes: 7 additions & 2 deletions core/src/main/java/org/jruby/runtime/backtrace/TraceType.java
Original file line number Diff line number Diff line change
@@ -399,7 +399,12 @@ protected static String printBacktraceJRuby(RubyException exception, boolean con
boolean color = console && runtime.getInstanceConfig().getBacktraceColor();

// exception line
String message = exception.message(context).toString();
String message;
try {
message = exception.callMethod(context, "message").toString();
} catch (org.jruby.exceptions.Exception _) {
message = exception.message(context).toString();
}
if (exception.getMetaClass() == runtime.getRuntimeError() && message.length() == 0) {
message = "No current exception";
}
@@ -505,4 +510,4 @@ private static void printErrorPos(ThreadContext context, PrintStream errorStream
}
}
}
}
}