From 6dd54e71a11b445d437d7f379947f94b4a6544b1 Mon Sep 17 00:00:00 2001 From: mihaylov Date: Tue, 28 Jun 2005 16:13:51 +0000 Subject: Introduced a top-level try-catch to hide the st... Introduced a top-level try-catch to hide the stack trace if the compiler throws AbortError exception; the -debug option prints the stack trace --- sources/scala/tools/scalac/Main.scala | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sources/scala/tools/scalac/Main.scala b/sources/scala/tools/scalac/Main.scala index 838019e53f..1542f98a21 100644 --- a/sources/scala/tools/scalac/Main.scala +++ b/sources/scala/tools/scalac/Main.scala @@ -48,9 +48,18 @@ object Main { val timer = scalac_Global.getTimer(reporter); timer.start(); val global = new Global(command, timer, false); - val units = global.compile(command.files.toArray(), false); - if (reporter.errors() == 0) - if (!global.PHASE.CODEGEN.hasSkipFlag()) global.dump(units); + try { + val units = global.compile(command.files.toArray(), false); + if (reporter.errors() == 0) + if (!global.PHASE.CODEGEN.hasSkipFlag()) global.dump(units); + } catch { + case e: scala.tools.util.debug.AbortError => + if (global.debug) + e.printStackTrace(); + else + global.error("Internal compiler error: " + e.getMessage() + + "; use -debug to see a stack trace"); + } timer.stop("total"); reporter.printSummary(); } -- cgit v1.2.3