GH-2127 Wrap event publishing in try/catch issuing warning in case of error

Resolves #2127
This commit is contained in:
Oleg Zhurakousky
2021-03-05 10:56:31 +01:00
parent 98a856ac4e
commit 051c43c0e9

View File

@@ -292,7 +292,13 @@ public class DefaultBinderFactory implements BinderFactory, DisposableBean, Appl
@Override
public void onApplicationEvent(ApplicationEvent event) {
if (context != null) {
context.publishEvent(event);
try {
context.publishEvent(event);
}
catch (Exception e) {
e.printStackTrace();
logger.warn("Failed to publish " + event, e);
}
}
}
});