Skip to content

Commit

Permalink
use better exception type and message
Browse files Browse the repository at this point in the history
  • Loading branch information
drunsinn committed Jun 22, 2024
1 parent 32e5e78 commit 97b095a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyLSV2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ def read_plc_address(self, address: str) -> Union[None, int, float, str]:
m_type, m_num = lm.decode_plc_memory_address(address)

if m_type is None or m_num is None:
raise ValueError()
raise LSV2InputException("could not translate address %s to valid memory location" % address)

return self.read_plc_memory(m_num, m_type, 1)[0]

Expand Down Expand Up @@ -1647,7 +1647,7 @@ def get_file_list(self, path: str = "", descend: bool = True, pattern: str = "")
return []

if self.change_directory(path) is False:
self._logger.warning("could not change to directory %s" % path)
self._logger.warning("could not change to directory %s", path)
return []

if len(pattern) == 0:
Expand Down

0 comments on commit 97b095a

Please sign in to comment.