moved config loading into the try-catch in which it was supposed to be in all along...

This commit is contained in:
Florian Nücke 2013-11-30 12:33:42 +01:00
parent b2b56419c9
commit e05a26c73d

View File

@ -150,13 +150,13 @@ object Settings {
out.close()
}
val defaults = ConfigFactory.defaultReference().withOnlyPath("opencomputers")
val config = ConfigFactory.parseFile(file).withFallback(defaults)
try {
val config = ConfigFactory.parseFile(file).withFallback(defaults)
settings = new Settings(config.getConfig("opencomputers"))
}
catch {
case e: Throwable =>
OpenComputers.log.log(Level.WARNING, "Failed loading config, using defaults.", e)
OpenComputers.log.warning("Failed loading config, using defaults. The reason was: " + e.getMessage)
settings = new Settings(defaults.getConfig("opencomputers"))
}
}