diff options
author | Daniel Bastos <dbastos@toledo.com> | 2016-09-21 09:26:40 -0300 |
---|---|---|
committer | Daniel Bastos <dbastos@toledo.com> | 2016-09-23 09:44:51 -0300 |
commit | 8ff8eca68f5fa5ed4f4ab8cca68682a5387abe32 (patch) | |
tree | d4cb27f5f4e49527acb9efc814421d161d5d079e /src/org/traccar/Context.java | |
parent | 411edf2fecc6f5d2cceba20f06958f729ebcca54 (diff) | |
download | trackermap-server-8ff8eca68f5fa5ed4f4ab8cca68682a5387abe32.tar.gz trackermap-server-8ff8eca68f5fa5ed4f4ab8cca68682a5387abe32.tar.bz2 trackermap-server-8ff8eca68f5fa5ed4f4ab8cca68682a5387abe32.zip |
Throws a RuntimeException if no configuration file was provided.
Diffstat (limited to 'src/org/traccar/Context.java')
-rw-r--r-- | src/org/traccar/Context.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java index c7359e76c..9e4d4a4f4 100644 --- a/src/org/traccar/Context.java +++ b/src/org/traccar/Context.java @@ -137,10 +137,12 @@ public final class Context { public static void init(String[] arguments) throws Exception { config = new Config(); - if (arguments.length > 0) { - config.load(arguments[0]); + if (arguments.length <= 0) { + throw new RuntimeException("Configuration file is not provided"); } + config.load(arguments[0]); + loggerEnabled = config.getBoolean("logger.enable"); if (loggerEnabled) { Log.setupLogger(config); |