Skip to content

Commit edaf11e

Browse files
authored
Log warning message and rethrow exceptions from events. (#1207)
Closes #1206.
1 parent bcf11ce commit edaf11e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/main/java/org/springframework/data/couchbase/core/CouchbaseTemplateSupport.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ public void maybeEmitEvent(CouchbaseMappingEvent<?> event) {
182182
try {
183183
this.applicationContext.publishEvent(event);
184184
} catch (Exception e) {
185-
LOG.error("exception emitting event "+event, e);
185+
LOG.warn("{} thrown during {}", e, event);
186+
throw e;
186187
}
187188
} else {
188189
LOG.info("maybeEmitEvent called, but CouchbaseTemplate not initialized with applicationContext");

src/main/java/org/springframework/data/couchbase/core/ReactiveCouchbaseTemplateSupport.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ public void maybeEmitEvent(CouchbaseMappingEvent<?> event) {
189189
try {
190190
this.applicationContext.publishEvent(event);
191191
} catch (Exception e) {
192-
LOG.error("exception emitting event "+event, e);
192+
LOG.warn("{} thrown during {}", e, event);
193+
throw e;
193194
}
194195
} else {
195196
LOG.info("maybeEmitEvent called, but ReactiveCouchbaseTemplate not initialized with applicationContext");

0 commit comments

Comments
 (0)