From 9498950b1c02cd77a2ab4a539f76a8f2ce2724c3 Mon Sep 17 00:00:00 2001 From: Louis Bergelson Date: Thu, 3 Oct 2013 16:52:48 -0400 Subject: [PATCH] Adding more specific error message when one of the scripts doesn't exist. --Previously it gave a cryptic message: ----IO error while decoding blarg.script with UTF-8 ----Please try specifying another one using the -encoding option --- .../src/org/broadinstitute/sting/queue/QScriptManager.scala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/scala/src/org/broadinstitute/sting/queue/QScriptManager.scala b/public/scala/src/org/broadinstitute/sting/queue/QScriptManager.scala index c6b8eff13..80dd53302 100644 --- a/public/scala/src/org/broadinstitute/sting/queue/QScriptManager.scala +++ b/public/scala/src/org/broadinstitute/sting/queue/QScriptManager.scala @@ -36,6 +36,7 @@ import org.apache.log4j.Level import org.broadinstitute.sting.queue.util.TextFormatUtils._ import org.broadinstitute.sting.utils.classloader.JVMUtils import scala.reflect.internal.util.{FakePos, NoPosition, Position, StringOps} +import org.broadinstitute.sting.utils.exceptions.UserException /** * Plugin manager for QScripts which loads QScripts into the current class loader. @@ -46,6 +47,11 @@ class QScriptManager() extends Logging { * Heavily based on scala/src/compiler/scala/tools/ant/Scalac.scala */ def loadScripts(scripts: Seq[File], tempDir: File) { + // Make sure the scripts actually exist. + scripts.foreach{ + file => if( !file.exists()) throw new UserException.CouldNotReadInputFile(file, "it does not exist.") + } + if (scripts.size > 0) { val settings = new Settings((error: String) => logger.error(error)) settings.deprecation.value = true