--- a/src/Pure/General/exn.scala Sat Aug 25 17:20:06 2018 +0200
+++ b/src/Pure/General/exn.scala Sat Aug 25 20:10:49 2018 +0200
@@ -138,4 +138,10 @@
def message(exn: Throwable): String =
user_message(exn) getOrElse (if (is_interrupt(exn)) "Interrupt" else exn.toString)
+
+
+ /* trace */
+
+ def trace(exn: Throwable): String =
+ exn.getStackTrace.mkString("\n")
}
--- a/src/Pure/System/command_line.scala Sat Aug 25 17:20:06 2018 +0200
+++ b/src/Pure/System/command_line.scala Sat Aug 25 20:10:49 2018 +0200
@@ -29,8 +29,7 @@
try { body }
catch {
case exn: Throwable =>
- if (debug) exn.printStackTrace
- Output.error_message(Exn.message(exn))
+ Output.error_message(Exn.message(exn) + (if (debug) "\n" + Exn.trace(exn) else ""))
Exn.return_code(exn, 2)
}
sys.exit(rc)