Skip to content

Commit 281e708

Browse files
committed
Configure ignoring of unsubscribe exceptions
1 parent ab84b19 commit 281e708

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

crypto-messenger-coder/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.example</groupId>
99
<artifactId>crypto-messenger</artifactId>
10-
<version>1.1.1</version>
10+
<version>1.1.2</version>
1111
</parent>
1212

1313
<artifactId>crypto-messenger-coder</artifactId>

crypto-messenger-desktop/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.example</groupId>
99
<artifactId>crypto-messenger</artifactId>
10-
<version>1.1.1</version>
10+
<version>1.1.2</version>
1111
</parent>
1212

1313
<artifactId>crypto-messenger-desktop</artifactId>

crypto-messenger-desktop/src/main/java/cryptomessenger/desktop/infrastructure/client/websocket/WebSocketManager.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,20 @@ private void connect() {
5454
}
5555

5656
public void refreshSubscriptions() {
57-
subscriptions.forEach(Subscription::unsubscribe);
57+
subscriptions.forEach(this::unsubscribe);
5858
subscriptions = messageHandlers.stream()
5959
.map(this::subscribe)
6060
.flatMap(Optional::stream)
6161
.collect(toSet());
6262
}
6363

64+
private void unsubscribe(Subscription subscription) {
65+
try {
66+
subscription.unsubscribe();
67+
} catch (Exception e) {
68+
}
69+
}
70+
6471
private Optional<Subscription> subscribe(MessageHandler handler) {
6572
var handlerName = handler.getClass().getSimpleName();
6673
try {

crypto-messenger-server/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.example</groupId>
99
<artifactId>crypto-messenger</artifactId>
10-
<version>1.1.1</version>
10+
<version>1.1.2</version>
1111
</parent>
1212

1313
<artifactId>crypto-messenger-server</artifactId>

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>org.example</groupId>
88
<artifactId>crypto-messenger</artifactId>
9-
<version>1.1.1</version>
9+
<version>1.1.2</version>
1010
<packaging>pom</packaging>
1111

1212
<modules>

0 commit comments

Comments
 (0)