Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,9 @@ else if (StompCommand.CONNECTED.equals(command)) {
}

if (StompCommand.ERROR.equals(command) && getErrorHandler() != null) {
Message<byte[]> errorMessage = getErrorHandler().handleErrorMessageToClient((Message<byte[]>) message);
Message<byte[]> enrichedMessage =
MessageBuilder.createMessage((byte[]) message.getPayload(), accessor.getMessageHeaders());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: rather than casting, you can use payload from the instanceOf at the top

Message<byte[]> errorMessage = getErrorHandler().handleErrorMessageToClient(enrichedMessage);
if (errorMessage != null) {
accessor = MessageHeaderAccessor.getAccessor(errorMessage, StompHeaderAccessor.class);
Assert.state(accessor != null, "No StompHeaderAccessor");
Expand Down