aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Bastos <dbastos@toledo.com>2016-09-21 09:26:40 -0300
committerDaniel Bastos <dbastos@toledo.com>2016-09-23 09:44:51 -0300
commit8ff8eca68f5fa5ed4f4ab8cca68682a5387abe32 (patch)
treed4cb27f5f4e49527acb9efc814421d161d5d079e /src
parent411edf2fecc6f5d2cceba20f06958f729ebcca54 (diff)
downloadtrackermap-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')
-rw-r--r--src/org/traccar/Context.java6
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);