Catch Throwable instead of Exception in Spring Application

...so that application startup that fails because of an Error (for
instance NoClassDefFoundError) won't be swallowed.

Fixes gh-1645
pull/2035/head
Dave Syer 10 years ago
parent 26a528ce95
commit 0ff511d978

@ -330,7 +330,7 @@ public class SpringApplication {
}
return context;
}
catch (Exception ex) {
catch (Throwable ex) {
try {
for (SpringApplicationRunListener runListener : runListeners) {
finishWithException(runListener, context, ex);
@ -696,7 +696,7 @@ public class SpringApplication {
}
private void finishWithException(SpringApplicationRunListener runListener,
ConfigurableApplicationContext context, Exception exception) {
ConfigurableApplicationContext context, Throwable exception) {
try {
runListener.finished(context, exception);
}

Loading…
Cancel
Save