summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-08-05 15:15:00 +0000
committerPaul Phillips <paulp@improving.org>2010-08-05 15:15:00 +0000
commitc690bf16b9dae7fec67b23b2deb105d7bd27621d (patch)
treea9c2368aa8610c2ab0a37d52d6feb000ec680f0e
parente51d5de4cb1076948b30d42b889d994850dea766 (diff)
downloadscala-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.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()) }
}