Additional error handling (#13146)
Signed-off-by: matchews <mmyers75@icloud.com>
This commit is contained in:
parent
d2670e40cb
commit
848ec83d52
|
@ -199,6 +199,7 @@ public class HaywardBridgeHandler extends BaseBridgeHandler {
|
|||
xmlResponse = httpXmlResponse(urlParameters);
|
||||
|
||||
if (xmlResponse.isEmpty()) {
|
||||
logger.debug("Hayward Connection thing: Login XML response was null");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -227,7 +228,7 @@ public class HaywardBridgeHandler extends BaseBridgeHandler {
|
|||
xmlResponse = httpXmlResponse(urlParameters);
|
||||
|
||||
if (xmlResponse.isEmpty()) {
|
||||
logger.debug("Hayward Connection thing: Login XML response was null");
|
||||
logger.debug("Hayward Connection thing: getApiDef XML response was null");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -277,12 +278,12 @@ public class HaywardBridgeHandler extends BaseBridgeHandler {
|
|||
String xmlResponse = httpXmlResponse(urlParameters);
|
||||
|
||||
if (xmlResponse.isEmpty()) {
|
||||
logger.debug("Hayward Connection thing: requestConfig XML response was null");
|
||||
logger.debug("Hayward Connection thing: getMSPConfig XML response was null");
|
||||
return "Fail";
|
||||
}
|
||||
|
||||
if (evaluateXPath("//Backyard/Name/text()", xmlResponse).isEmpty()) {
|
||||
logger.debug("Hayward Connection thing: requestConfiguration XML response: {}", xmlResponse);
|
||||
logger.debug("Hayward Connection thing: getMSPConfig XML response: {}", xmlResponse);
|
||||
return "Fail";
|
||||
}
|
||||
return xmlResponse;
|
||||
|
@ -294,6 +295,10 @@ public class HaywardBridgeHandler extends BaseBridgeHandler {
|
|||
|
||||
String xmlResponse = getMspConfig();
|
||||
|
||||
if (xmlResponse.contentEquals("Fail")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get Units (Standard, Metric)
|
||||
property1 = evaluateXPath("//System/Units/text()", xmlResponse);
|
||||
account.units = property1.get(0);
|
||||
|
|
Loading…
Reference in New Issue