aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/Main.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-04-27 07:46:24 -0700
committerAnton Tananaev <anton@traccar.org>2024-04-27 07:46:24 -0700
commit8da81efe902ceb9a106dff15ce44638c6be1eecc (patch)
treecaf73fa775dda8ba7f6a1d8d68f41b4ae8ad7ffb /src/main/java/org/traccar/Main.java
parent3b739942dafea3c9d2bb3f061fb6ee98a33c747a (diff)
downloadtrackermap-server-8da81efe902ceb9a106dff15ce44638c6be1eecc.tar.gz
trackermap-server-8da81efe902ceb9a106dff15ce44638c6be1eecc.tar.bz2
trackermap-server-8da81efe902ceb9a106dff15ce44638c6be1eecc.zip
Better DB lock error message
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);
}
}