Skip to content

Commit 1149634

Browse files
committed
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.
1 parent 25b7a16 commit 1149634

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/dotty/tools/dotc/Run.scala

+6-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import reporting.Reporter
1010
import transform.TreeChecker
1111
import java.io.{BufferedWriter, OutputStreamWriter}
1212
import scala.reflect.io.VirtualFile
13+
import scala.util.control.NonFatal
1314

1415
class Run(comp: Compiler)(implicit ctx: Context) {
1516

@@ -27,9 +28,13 @@ class Run(comp: Compiler)(implicit ctx: Context) {
2728
}
2829
}
2930

30-
def compile(fileNames: List[String]): Unit = {
31+
def compile(fileNames: List[String]): Unit = try {
3132
val sources = fileNames map getSource
3233
compileSources(sources)
34+
} catch {
35+
case NonFatal(ex) =>
36+
println(s"exception occurred while compiling $units%, %")
37+
throw ex
3338
}
3439

3540
/** TODO: There's a fundamental design problem here: We assmble phases using `squash`

0 commit comments

Comments
 (0)