Skip to content

Commit c48126d

Browse files
committed
Add comments
1 parent fd26b00 commit c48126d

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/main/java/com/iexec/worker/pubsub/StompClient.java

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,37 @@ public void afterConnected(StompSession session, StompHeaders connectedHeaders)
133133
eventPublisher.publishEvent(new SessionCreatedEvent());
134134
}
135135

136+
/**
137+
* Handle any exception arising while processing a STOMP frame such as a
138+
* failure to convert the payload or an unhandled exception in the
139+
* application {@code StompFrameHandler}.
140+
*
141+
* @param session the client STOMP session
142+
* @param command the STOMP command of the frame
143+
* @param headers the headers
144+
* @param payload the raw payload
145+
* @param exception the exception
146+
*/
136147
@Override
137148
public void handleException(StompSession session, @Nullable StompCommand command,
138149
StompHeaders headers, byte[] payload, Throwable exception) {
139150
SimpMessageType messageType = command != null ? command.getMessageType() : null;
140-
log.error("STOMP error [session: {}, isConnected: {}, command: {}, exception: {}]",
151+
log.error("STOMP frame processing error [session: {}, isConnected: {}, command: {}, exception: {}]",
141152
session.getSessionId(), session.isConnected(), messageType, exception.getMessage());
142153
}
143154

155+
/**
156+
* Handle a low level transport error which could be an I/O error or a
157+
* failure to encode or decode a STOMP message.
158+
* <p>Note that
159+
* {@link org.springframework.messaging.simp.stomp.ConnectionLostException
160+
* ConnectionLostException} will be passed into this method when the
161+
* connection is lost rather than closed normally via
162+
* {@link StompSession#disconnect()}.
163+
*
164+
* @param session the client STOMP session
165+
* @param exception the exception that occurred
166+
*/
144167
@Override
145168
public void handleTransportError(StompSession session, Throwable exception) {
146169
log.error("STOMP transport error [session: {}, isConnected: {}, exception: {}]",

0 commit comments

Comments
 (0)