uModbus
uModbus copied to clipboard
Convert unknown error codes to a useful exception class.
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.
Coverage decreased (-0.3%) to 95.969% when pulling c3212d6094017aabe6329a52c646cd82f10c41f3 on acolomb:handle-undefined-error-codes into f1128a73e43f565bacedd1ae99d077d7c9c831f3 on AdvancedClimateSystems:master.
The docstrings for all these exception classes are somewhat inconsistent. If you like, I will include a commit making them PEP-257 compliant.