Skip to content

Instantly share code, notes, and snippets.

@headius
Created September 30, 2013 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save headius/6764310 to your computer and use it in GitHub Desktop.
Save headius/6764310 to your computer and use it in GitHub Desktop.
diff --git a/core/src/main/java/org/jruby/Ruby.java b/core/src/main/java/org/jruby/Ruby.java
index 1d12ac0..4ede395 100644
--- a/core/src/main/java/org/jruby/Ruby.java
+++ b/core/src/main/java/org/jruby/Ruby.java
@@ -2706,6 +2706,7 @@ public final class Ruby {
}
PrintStream errorStream = getErrorStream();
+ errorStream.println("Unhandled exception in thread " + Thread.currentThread().getName() + ":");
errorStream.print(config.getTraceType().printBacktrace(excp, errorStream == System.err && getPosix().isatty(FileDescriptor.err)));
}
diff --git a/core/src/main/java/org/jruby/RubyThread.java b/core/src/main/java/org/jruby/RubyThread.java
index d03135e..e6c89f2 100644
--- a/core/src/main/java/org/jruby/RubyThread.java
+++ b/core/src/main/java/org/jruby/RubyThread.java
@@ -1178,7 +1178,8 @@ public class RubyThread extends RubyObject implements ExecutionContext {
runtime.getThreadService().getMainThread().raise(new IRubyObject[] {systemExit}, Block.NULL_BLOCK);
return;
- } else if (runtime.getDebug().isTrue()) {
+ } else {
+ // mri-6647: log something for raised exceptions when not aborting
runtime.printError(exception.getException());
}
exitingException = exception;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment