aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/Main.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/Main.java')
-rw-r--r--src/main/java/org/traccar/Main.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/Main.java b/src/main/java/org/traccar/Main.java
index 33fcf654f..943b5bd7d 100644
--- a/src/main/java/org/traccar/Main.java
+++ b/src/main/java/org/traccar/Main.java
@@ -17,6 +17,7 @@ package org.traccar;
import com.google.inject.Guice;
import com.google.inject.Injector;
+import com.google.inject.ProvisionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.traccar.broadcast.BroadcastService;
@@ -142,8 +143,14 @@ public final class Main {
}
}));
} catch (Exception e) {
- LOGGER.error("Main method error", e);
- throw new RuntimeException(e);
+ Throwable unwrapped;
+ if (e instanceof ProvisionException) {
+ unwrapped = e.getCause();
+ } else {
+ unwrapped = e;
+ }
+ LOGGER.error("Main method error", unwrapped);
+ System.exit(1);
}
}