Commit 3946dd26 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Fix bug when json parse failed

parent 22fdb87e
......@@ -27,12 +27,12 @@ class Config(var map: Map[String, Any]) extends Logging {
logger.debug("Jsonfile: " + configFile)
val jsonText = scala.io.Source.fromFile(configFile).mkString
val json = Parse.parseOption(jsonText)
if (json == None) {
throw new IllegalStateException("The config JSON file is either not properly formatted or not a JSON file, file: " + configFile)
}
logger.debug(json)
val configJson = jsonToMap(json.get)
logger.debug("Contain: " + configJson)
if (configJson == None) {
throw new IllegalStateException("The config JSON file is either not properly formatted or not a JSON file, file: " + configFile)
}
if (map.isEmpty) map = configJson
else map = Config.mergeMaps(configJson, map)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment