Keep original startup error message
This commit is contained in:
@@ -25,6 +25,7 @@ public class DevStackApplication {
|
||||
CountDownLatch shutdownLatch = new CountDownLatch(1);
|
||||
ScheduledExecutorService scheduler = null;
|
||||
AtomicBoolean shuttingDown = new AtomicBoolean(false);
|
||||
RuntimeException startupFailure = null;
|
||||
|
||||
try {
|
||||
validateJavaVersion();
|
||||
@@ -42,6 +43,7 @@ public class DevStackApplication {
|
||||
scheduler = startDatabaseWatch(docker, context, shuttingDown);
|
||||
shutdownLatch.await();
|
||||
} catch (RuntimeException ex) {
|
||||
startupFailure = ex;
|
||||
throw new IllegalStateException(describeStartupFailure(ex), ex);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
@@ -54,7 +56,15 @@ public class DevStackApplication {
|
||||
context.close();
|
||||
}
|
||||
if (!shuttingDown.get()) {
|
||||
docker.stopDatabase();
|
||||
try {
|
||||
docker.stopDatabase();
|
||||
} catch (RuntimeException stopFailure) {
|
||||
if (startupFailure != null) {
|
||||
System.err.println(stopFailure.getMessage());
|
||||
} else {
|
||||
throw stopFailure;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user