Skip to content

Commit 9db328b

Browse files
kalinkostashkithjaeckle
authored andcommitted
properly handled InterruptedException
Signed-off-by: Kalin Kostashki <kalin.kostashki@bosch.com>
1 parent 0f8e474 commit 9db328b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

java/src/main/java/org/eclipse/ditto/client/messaging/internal/WebSocketMessagingProvider.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,15 @@ public void onConnected(final WebSocket websocket, final Map<String, List<String
372372
LOGGER.debug("Reconnecting is completed -> emitting subscriptionMessages: {}", subscriptionMessages);
373373
subscriptionMessages.values().forEach(this::emit);
374374
}
375-
} catch (TimeoutException | InterruptedException | ExecutionException e) {
375+
} catch (TimeoutException | ExecutionException e) {
376376
isReconnecting.complete(false);
377377
fixedRateChecker.cancel(true);
378378
LOGGER.error("Reconnecting failed: {}", e.getMessage());
379+
} catch (InterruptedException e) {
380+
isReconnecting.complete(false);
381+
fixedRateChecker.cancel(true);
382+
LOGGER.error("Reconnecting failed due to thread being interrupted: {}", e.getMessage());
383+
Thread.currentThread().interrupt();
379384
}
380385
}
381386
});

0 commit comments

Comments
 (0)