@NonNullByDefault
public class Tr064CommunicationException extends Exception {
private static final long serialVersionUID = 1L;
+ private String soapError = "";
+ private int httpError = 0;
public Tr064CommunicationException(Exception e) {
super(e);
public Tr064CommunicationException(String s) {
super(s);
}
+
+ public Tr064CommunicationException(String s, Integer httpError, String soapError) {
+ super(s);
+ this.httpError = httpError;
+ this.soapError = soapError;
+ };
+
+ public String getSoapError() {
+ return soapError;
+ }
+
+ public int getHttpError() {
+ return httpError;
+ }
}
String soapReason = getSOAPElement(soapMessage, "errorDescription").orElse("unknown");
String error = String.format("HTTP-Response-Code %d (%s), SOAP-Fault: %s (%s)",
response.getStatus(), response.getReason(), soapError, soapReason);
- throw new Tr064CommunicationException(error);
+ throw new Tr064CommunicationException(error, response.getStatus(), soapError);
}
return soapMessage;
}
.orElseThrow(() -> new Tr064CommunicationException("failed to transform '"
+ channelConfig.getChannelTypeDescription().getGetAction().getArgument() + "'"));
} catch (Tr064CommunicationException e) {
- logger.info("Failed to get {}: {}", channelConfig, e.getMessage());
+ if (e.getHttpError() == 500) {
+ switch (e.getSoapError()) {
+ case "714":
+ // NoSuchEntryInArray usually is an unknown entry in the MAC list
+ logger.debug("Failed to get {}: {}", channelConfig, e.getMessage());
+ return UnDefType.UNDEF;
+ default:
+ }
+ }
+ // all other cases are an error
+ logger.warn("Failed to get {}: {}", channelConfig, e.getMessage());
return UnDefType.UNDEF;
}
}