Ensure startup error is logged (and rethrown)
Fixes gh-948
This commit is contained in:
@@ -324,17 +324,20 @@ public class SpringApplication {
|
||||
return context;
|
||||
}
|
||||
catch (Exception ex) {
|
||||
for (SpringApplicationRunListener runListener : runListeners) {
|
||||
finishWithException(runListener, context, ex);
|
||||
try {
|
||||
for (SpringApplicationRunListener runListener : runListeners) {
|
||||
finishWithException(runListener, context, ex);
|
||||
}
|
||||
this.log.error("Application startup failed", ex);
|
||||
}
|
||||
if (context != null) {
|
||||
context.close();
|
||||
finally {
|
||||
if (context != null) {
|
||||
context.close();
|
||||
}
|
||||
}
|
||||
ReflectionUtils.rethrowRuntimeException(ex);
|
||||
return context;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
|
||||
private Collection<SpringApplicationRunListener> getRunListeners(String[] args) {
|
||||
|
||||
Reference in New Issue
Block a user