diff options
author | Paul Phillips <paulp@improving.org> | 2010-08-05 15:15:00 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-08-05 15:15:00 +0000 |
commit | c690bf16b9dae7fec67b23b2deb105d7bd27621d (patch) | |
tree | a9c2368aa8610c2ab0a37d52d6feb000ec680f0e | |
parent | e51d5de4cb1076948b30d42b889d994850dea766 (diff) | |
download | scala-c690bf16b9dae7fec67b23b2deb105d7bd27621d.tar.gz scala-c690bf16b9dae7fec67b23b2deb105d7bd27621d.tar.bz2 scala-c690bf16b9dae7fec67b23b2deb105d7bd27621d.zip |
Widened a try block to unregress the error mess...
Widened a try block to unregress the error message for file not found.
Closes #3729, no review.
-rw-r--r-- | src/compiler/scala/tools/nsc/Global.scala | 10 |
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()) } } |