Browse Source

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 11 years ago
parent
commit
0ff511d978
  1. 4
      spring-boot/src/main/java/org/springframework/boot/SpringApplication.java

4
spring-boot/src/main/java/org/springframework/boot/SpringApplication.java

@ -330,7 +330,7 @@ public class SpringApplication { @@ -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 { @@ -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