Skip to content

Commit

Permalink
Interrupt current thread on InterruptedException (openhab#12323)
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
  • Loading branch information
jlaur authored and andan67 committed Nov 5, 2022
1 parent 0158826 commit 3a4f6a6
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -562,6 +562,9 @@ private synchronized String invoke(HttpMethod method, String url, @Nullable Quer
try {
response = request.send();
} catch (InterruptedException | TimeoutException | ExecutionException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
if (Instant.now().isBefore(maintenanceScheduledEnd)) {
// throw "softer" exception during maintenance window
logger.debug("Hub still undergoing maintenance");
Expand Down

0 comments on commit 3a4f6a6

Please sign in to comment.