diff --git a/biopet-framework/src/main/java/nl/lumc/sasc/biopet/core/Config.scala b/biopet-framework/src/main/java/nl/lumc/sasc/biopet/core/Config.scala index 6a4d7ca0828855ca8561936e5eae204d0f9ce7bb..61e92f579c42fbb1fcbeb714487f7afdd47ee119 100644 --- a/biopet-framework/src/main/java/nl/lumc/sasc/biopet/core/Config.scala +++ b/biopet-framework/src/main/java/nl/lumc/sasc/biopet/core/Config.scala @@ -19,8 +19,8 @@ class Config(var map: Map[String,Any]) extends Logging { logger.info("Loading config file: " + file) loadConfigFile(file) } - else logger.warn("QUEUE_CONFIG value found but file does not exist, no glogal config is loaded") - } else logger.warn("QUEUE_CONFIG value not found, no glogal config is loaded") + else logger.warn("QUEUE_CONFIG value found but file does not exist, no global config is loaded") + } else logger.warn("QUEUE_CONFIG value not found, no global config is loaded") } def contains(s:String) : Boolean = map.contains(s) @@ -28,6 +28,12 @@ class Config(var map: Map[String,Any]) extends Logging { def loadConfigFile(configFile:File) { var returnMap: Map[String,Any] = Map() var configJson = JSON.parseFull(scala.io.Source.fromFile(configFile).mkString) + + if ( configJson == None ) { + println( "[ERROR] The config JSON file is either not properly formatted or not a JSON file" ) + System.exit(1) + } + this.logger.debug("Jsonfile: " + configFile) this.logger.debug("Contain: " + configJson) configJson.get match {