Skip to content

Commit 4e1c0c6

Browse files
committed
@MessageExceptionHandler supports error signal
Before this change if a controller method returned a Publisher whose first signal was an error, the error signal would not be delegated to a @MessageExceptionHandler method as expected. To make this work for now we use a package private local copy of the ChannelSendOperator from spring-web. See gh-21987
1 parent d6f4ec8 commit 4e1c0c6

File tree

5 files changed

+463
-9
lines changed

5 files changed

+463
-9
lines changed

spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/reactive/AbstractEncoderMethodReturnValueHandler.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ public Mono<Void> handleReturnValue(
112112
Flux<DataBuffer> encodedContent = encodeContent(
113113
returnValue, returnType, bufferFactory, mimeType, Collections.emptyMap());
114114

115-
return handleEncodedContent(encodedContent, returnType, message);
115+
return new ChannelSendOperator<>(encodedContent, publisher ->
116+
handleEncodedContent(Flux.from(publisher), returnType, message));
116117
}
117118

118119
@SuppressWarnings("unchecked")

0 commit comments

Comments
 (0)