From d39e24bdf09f0ba546dbc54b44412563895b21e0 Mon Sep 17 00:00:00 2001 From: lolodomo Date: Mon, 5 Apr 2021 15:05:42 +0200 Subject: [PATCH] [remoteopenhab] Avoid catching Exception (#10461) Signed-off-by: Laurent Garnier --- .../internal/rest/RemoteopenhabRestClient.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/rest/RemoteopenhabRestClient.java b/bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/rest/RemoteopenhabRestClient.java index 8789b1d3930..b6ebe5d1a33 100644 --- a/bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/rest/RemoteopenhabRestClient.java +++ b/bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/rest/RemoteopenhabRestClient.java @@ -14,6 +14,7 @@ package org.openhab.binding.remoteopenhab.internal.rest; import java.io.ByteArrayOutputStream; import java.io.EOFException; +import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.Arrays; @@ -25,6 +26,7 @@ import java.util.Objects; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.SSLSession; @@ -576,7 +578,10 @@ public class RemoteopenhabRestClient { } else { throw new RemoteopenhabException(e); } - } catch (Exception e) { + } catch (IOException | TimeoutException e) { + throw new RemoteopenhabException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); throw new RemoteopenhabException(e); } }