Skip to content

Commit a985b73

Browse files
committed
Improve logging in ReactiveTypeHandler
See gh-34188
1 parent 6ec7dcf commit a985b73

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
@@ -364,7 +364,14 @@ public void run() {
364364
logger.debug("Send for " + this.emitter + " failed: " + ex);
365365
}
366366
terminate();
367-
this.emitter.completeWithError(ex);
367+
try {
368+
this.emitter.completeWithError(ex);
369+
}
370+
catch (Exception ex2) {
371+
if (logger.isDebugEnabled()) {
372+
logger.debug("Failure from emitter completeWithError: " + ex2);
373+
}
374+
}
368375
return;
369376
}
370377
}
@@ -377,13 +384,27 @@ public void run() {
377384
if (logger.isDebugEnabled()) {
378385
logger.debug("Publisher for " + this.emitter + " failed: " + ex);
379386
}
380-
this.emitter.completeWithError(ex);
387+
try {
388+
this.emitter.completeWithError(ex);
389+
}
390+
catch (Exception ex2) {
391+
if (logger.isDebugEnabled()) {
392+
logger.debug("Failure from emitter completeWithError: " + ex2);
393+
}
394+
}
381395
}
382396
else {
383397
if (logger.isTraceEnabled()) {
384398
logger.trace("Publisher for " + this.emitter + " completed");
385399
}
386-
this.emitter.complete();
400+
try {
401+
this.emitter.complete();
402+
}
403+
catch (Exception ex2) {
404+
if (logger.isDebugEnabled()) {
405+
logger.debug("Failure from emitter complete: " + ex2);
406+
}
407+
}
387408
}
388409
return;
389410
}

0 commit comments

Comments
 (0)