Skip to content

Commit

Permalink
[knx] Handle exceptions during initial read
Browse files Browse the repository at this point in the history
fixes #7239

Signed-off-by: Holger Friedrich <[email protected]>
  • Loading branch information
holgerfriedrich committed Mar 27, 2022
1 parent 378a037 commit 7f62dde
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import tuwien.auto.calimero.GroupAddress;
import tuwien.auto.calimero.IndividualAddress;
import tuwien.auto.calimero.KNXException;
import tuwien.auto.calimero.KnxRuntimeException;
import tuwien.auto.calimero.datapoint.CommandDP;
import tuwien.auto.calimero.datapoint.Datapoint;
import tuwien.auto.calimero.device.ProcessCommunicationResponder;
Expand Down Expand Up @@ -299,6 +300,11 @@ private void readNextQueuedDatapoint() {
logger.warn("Giving up reading datapoint {}, the number of maximum retries ({}) is reached.",
datapoint.getDatapoint().getMainAddress(), datapoint.getLimit());
}
} catch (KnxRuntimeException e) {
// KnxRuntimeException is _not_ a subclass of KnxException. Fail gracefully, notify user, continue
// reading next DP. Note: Also catches KnxSecureException, KnxIllegArgumentException.
logger.warn("Error reading datapoint {}: {}", datapoint.getDatapoint().getMainAddress(),
e.getMessage());
} catch (InterruptedException e) {
logger.debug("Interrupted sending KNX read request");
return;
Expand Down

0 comments on commit 7f62dde

Please sign in to comment.