Commit 0ff511d9 authored by Dave Syer's avatar Dave Syer

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
parent 26a528ce
...@@ -330,7 +330,7 @@ public class SpringApplication { ...@@ -330,7 +330,7 @@ public class SpringApplication {
} }
return context; return context;
} }
catch (Exception ex) { catch (Throwable ex) {
try { try {
for (SpringApplicationRunListener runListener : runListeners) { for (SpringApplicationRunListener runListener : runListeners) {
finishWithException(runListener, context, ex); finishWithException(runListener, context, ex);
...@@ -696,7 +696,7 @@ public class SpringApplication { ...@@ -696,7 +696,7 @@ public class SpringApplication {
} }
private void finishWithException(SpringApplicationRunListener runListener, private void finishWithException(SpringApplicationRunListener runListener,
ConfigurableApplicationContext context, Exception exception) { ConfigurableApplicationContext context, Throwable exception) {
try { try {
runListener.finished(context, exception); runListener.finished(context, exception);
} }
......
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