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