]> git.basschouten.com Git - openhab-addons.git/commitdiff
[remoteopenhab] Avoid catching Exception (#10461)
authorlolodomo <lg.hc@free.fr>
Mon, 5 Apr 2021 13:05:42 +0000 (15:05 +0200)
committerGitHub <noreply@github.com>
Mon, 5 Apr 2021 13:05:42 +0000 (15:05 +0200)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/rest/RemoteopenhabRestClient.java

index 8789b1d3930a146b4a05f108375c45e2294d3851..b6ebe5d1a330717bdc62657fd396f22e3acfb644 100644 (file)
@@ -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);
         }
     }