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
This commit is contained in:
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…
Reference in New Issue