[bindings d-e] Fix exception handling (Jetty HTTP client) (#10476)

Fixes #10474

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
lolodomo
2021-04-06 17:37:19 +02:00
committed by GitHub
parent fed460218e
commit 8ab37ce285
20 changed files with 73 additions and 62 deletions

View File

@@ -363,6 +363,9 @@ public abstract class DLinkHNAPCommunication {
} catch (final NoSuchAlgorithmException e) {
logger.debug("login - Internal error", e);
status = HNAPStatus.INTERNAL_ERROR;
} catch (final InterruptedException e) {
status = HNAPStatus.COMMUNICATION_ERROR;
Thread.currentThread().interrupt();
} catch (final Exception e) {
// Assume there has been some problem trying to send one of the messages
if (status != HNAPStatus.COMMUNICATION_ERROR) {

View File

@@ -278,6 +278,9 @@ public class DLinkMotionSensorCommunication extends DLinkHNAPCommunication {
} else {
unexpectedResult("getLastDetection - Unexpected response", soapResponse);
}
} catch (final InterruptedException e) {
status = DeviceStatus.COMMUNICATION_ERROR;
Thread.currentThread().interrupt();
} catch (final Exception e) {
// Assume there has been some problem trying to send one of the messages
if (status != DeviceStatus.COMMUNICATION_ERROR) {