1
0
mirror of https://github.com/JoelBender/bacpypes synced 2025-10-05 22:18:16 +08:00

slightly better error message

This commit is contained in:
Joel Bender 2017-05-23 02:38:25 -04:00
parent 3c223f711b
commit 777ee04843

View File

@ -57,7 +57,7 @@ class Network:
return return
if not pdu.pduDestination or not isinstance(pdu.pduDestination, Address): if not pdu.pduDestination or not isinstance(pdu.pduDestination, Address):
raise RuntimeError("invalid destination address") raise RuntimeError("invalid destination address: %r" % (pdu.pduDestination,))
elif pdu.pduDestination.addrType == Address.localBroadcastAddr: elif pdu.pduDestination.addrType == Address.localBroadcastAddr:
for n in self.nodes: for n in self.nodes:
@ -70,7 +70,7 @@ class Network:
n.response(deepcopy(pdu)) n.response(deepcopy(pdu))
else: else:
raise RuntimeError("invalid destination address type") raise RuntimeError("invalid destination address type: %r" % (pdu.pduDestination,))
def __len__(self): def __len__(self):
""" Simple way to determine the number of nodes in the network. """ """ Simple way to determine the number of nodes in the network. """