Skip to content

Commit e1b06cc

Browse files
committed
Improve logging in ReactiveTypeHandler
See gh-34188
1 parent 9eefdb8 commit e1b06cc

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ReactiveTypeHandler.java

+24-3
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,14 @@ public void run() {
337337
logger.debug("Send for " + this.emitter + " failed: " + ex);
338338
}
339339
terminate();
340-
this.emitter.completeWithError(ex);
340+
try {
341+
this.emitter.completeWithError(ex);
342+
}
343+
catch (Exception ex2) {
344+
if (logger.isDebugEnabled()) {
345+
logger.debug("Failure from emitter completeWithError: " + ex2);
346+
}
347+
}
341348
return;
342349
}
343350
}
@@ -350,13 +357,27 @@ public void run() {
350357
if (logger.isDebugEnabled()) {
351358
logger.debug("Publisher for " + this.emitter + " failed: " + ex);
352359
}
353-
this.emitter.completeWithError(ex);
360+
try {
361+
this.emitter.completeWithError(ex);
362+
}
363+
catch (Exception ex2) {
364+
if (logger.isDebugEnabled()) {
365+
logger.debug("Failure from emitter completeWithError: " + ex2);
366+
}
367+
}
354368
}
355369
else {
356370
if (logger.isTraceEnabled()) {
357371
logger.trace("Publisher for " + this.emitter + " completed");
358372
}
359-
this.emitter.complete();
373+
try {
374+
this.emitter.complete();
375+
}
376+
catch (Exception ex2) {
377+
if (logger.isDebugEnabled()) {
378+
logger.debug("Failure from emitter complete: " + ex2);
379+
}
380+
}
360381
}
361382
return;
362383
}

0 commit comments

Comments
 (0)