Commit 0938a874 authored by Dave Syer's avatar Dave Syer

Ensure startup error is logged (and rethrown)

Fixes gh-948
parent 32295b9b
...@@ -324,17 +324,20 @@ public class SpringApplication { ...@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment