From 79aa0a43accc0da9332a110d24e771465b4bc765 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 30 Sep 2023 12:12:35 +0200 Subject: [PATCH] fix broken error code checking fix reported error from #52 --- pyLSV2/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyLSV2/client.py b/pyLSV2/client.py index 5d0509d..6e16875 100644 --- a/pyLSV2/client.py +++ b/pyLSV2/client.py @@ -1678,7 +1678,7 @@ def get_error_messages(self) -> List[ld.NCErrorMessage]: messages.append(lm.decode_error_message(result)) result = self._send_recive(lc.CMD.R_RI, payload, lc.RSP.S_RI) - if self.last_error is lc.LSV2StatusCode.T_ER_NO_NEXT_ERROR: + if self.last_error.e_code is lc.LSV2StatusCode.T_ER_NO_NEXT_ERROR: self._logger.debug("successfully read all errors") else: self._logger.warning( @@ -1687,7 +1687,7 @@ def get_error_messages(self) -> List[ld.NCErrorMessage]: return messages - if self.last_error is lc.LSV2StatusCode.T_ER_NO_NEXT_ERROR: + if self.last_error.e_code is lc.LSV2StatusCode.T_ER_NO_NEXT_ERROR: self._logger.debug( "successfully read first error but no error active") return messages