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 73024136d6
commit 0b297fcb37

View File

@@ -298,7 +298,12 @@ 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) {
logger.warn("Failed to publish " + event, e);
}
}
}
});