From 8ff8eca68f5fa5ed4f4ab8cca68682a5387abe32 Mon Sep 17 00:00:00 2001 From: Daniel Bastos Date: Wed, 21 Sep 2016 09:26:40 -0300 Subject: Throws a RuntimeException if no configuration file was provided. --- src/org/traccar/Context.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') 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); -- cgit v1.2.3