Skip to content

Commit a7eca1b

Browse files
committed
handle exception on ws send
1 parent 0c1c7d0 commit a7eca1b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

core/src/main/java/com/flowci/core/common/manager/SocketPushManager.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,16 @@ public void push(String topic, PushEvent event, Object obj) {
4444
PushBody push = new PushBody(event, obj);
4545
String json = objectMapper.writeValueAsString(push);
4646
simpMessagingTemplate.convertAndSend(topic, json);
47-
} catch (IOException e) {
47+
} catch (Exception e) {
4848
log.warn(e.getMessage());
4949
}
5050
}
5151

5252
public void push(String topic, byte[] bytes) {
53-
simpMessagingTemplate.convertAndSend(topic, bytes);
53+
try {
54+
simpMessagingTemplate.convertAndSend(topic, bytes);
55+
} catch (Exception e) {
56+
log.warn(e.getMessage());
57+
}
5458
}
5559
}

0 commit comments

Comments
 (0)