From c690bf16b9dae7fec67b23b2deb105d7bd27621d Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Thu, 5 Aug 2010 15:15:00 +0000 Subject: 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. --- src/compiler/scala/tools/nsc/Global.scala | 10 ++++++---- 1 file 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()) } } -- cgit v1.2.3