Log warning message and rethrow exceptions from events. (#1207)

Closes #1206.
This commit is contained in:
Michael Reiche
2021-08-26 15:09:34 -07:00
committed by GitHub
parent bcf11ce856
commit edaf11ed85
2 changed files with 4 additions and 2 deletions

View File

@@ -182,7 +182,8 @@ class CouchbaseTemplateSupport implements ApplicationContextAware, TemplateSuppo
try {
this.applicationContext.publishEvent(event);
} catch (Exception e) {
LOG.error("exception emitting event "+event, e);
LOG.warn("{} thrown during {}", e, event);
throw e;
}
} else {
LOG.info("maybeEmitEvent called, but CouchbaseTemplate not initialized with applicationContext");

View File

@@ -189,7 +189,8 @@ class ReactiveCouchbaseTemplateSupport implements ApplicationContextAware, React
try {
this.applicationContext.publishEvent(event);
} catch (Exception e) {
LOG.error("exception emitting event "+event, e);
LOG.warn("{} thrown during {}", e, event);
throw e;
}
} else {
LOG.info("maybeEmitEvent called, but ReactiveCouchbaseTemplate not initialized with applicationContext");