From 114963430eb0ef5519e7ec073a18eef0bc264237 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 28 Apr 2015 14:22:41 +0200 Subject: Display compiled files in case of exception This is useful for reproducing a problem. It tells us in particular in what order fiels were compiled. --- src/dotty/tools/dotc/Run.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/Run.scala') diff --git a/src/dotty/tools/dotc/Run.scala b/src/dotty/tools/dotc/Run.scala index af9c878f0..3d4cd988e 100644 --- a/src/dotty/tools/dotc/Run.scala +++ b/src/dotty/tools/dotc/Run.scala @@ -10,6 +10,7 @@ import reporting.Reporter import transform.TreeChecker import java.io.{BufferedWriter, OutputStreamWriter} import scala.reflect.io.VirtualFile +import scala.util.control.NonFatal class Run(comp: Compiler)(implicit ctx: Context) { @@ -27,9 +28,13 @@ class Run(comp: Compiler)(implicit ctx: Context) { } } - def compile(fileNames: List[String]): Unit = { + def compile(fileNames: List[String]): Unit = try { val sources = fileNames map getSource compileSources(sources) + } catch { + case NonFatal(ex) => + println(s"exception occurred while compiling $units%, %") + throw ex } /** TODO: There's a fundamental design problem here: We assmble phases using `squash` -- cgit v1.2.3