uModbus icon indicating copy to clipboard operation
uModbus copied to clipboard

Convert unknown error codes to a useful exception class.

Open acolomb opened this issue 4 years ago • 2 comments

Introduce an UndefinedModbusException class and use it when the lookup in error_code_to_exception_map fails. Previously that would just throw a KeyError with the contained value, so this change makes it more obvious what actually happened.

acolomb avatar Feb 03 '21 08:02 acolomb

Coverage Status

Coverage decreased (-0.3%) to 95.969% when pulling c3212d6094017aabe6329a52c646cd82f10c41f3 on acolomb:handle-undefined-error-codes into f1128a73e43f565bacedd1ae99d077d7c9c831f3 on AdvancedClimateSystems:master.

coveralls avatar Feb 03 '21 08:02 coveralls

The docstrings for all these exception classes are somewhat inconsistent. If you like, I will include a commit making them PEP-257 compliant.

acolomb avatar Feb 03 '21 09:02 acolomb