summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala
index cca0760233..8e3fe907a8 100644
--- a/src/compiler/scala/tools/nsc/Global.scala
+++ b/src/compiler/scala/tools/nsc/Global.scala
@@ -810,11 +810,13 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable
/** Compile list of files given by their names */
def compile(filenames: List[String]) {
- val sources: List[SourceFile] =
- if (isScriptRun && filenames.size > 1) returning(Nil)(_ => error("can only compile one script at a time"))
- else filenames map getSourceFile
+ try {
+ val sources: List[SourceFile] =
+ if (isScriptRun && filenames.size > 1) returning(Nil)(_ => error("can only compile one script at a time"))
+ else filenames map getSourceFile
- try compileSources(sources)
+ compileSources(sources)
+ }
catch { case ex: IOException => error(ex.getMessage()) }
}