From da39c07da6e2016990e322718955eccdfd0f1807 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 4 Dec 2019 00:13:42 -0500 Subject: [PATCH] Unknown Error if error code is present but not matched in dump_errors --- tools/odrive/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/odrive/utils.py b/tools/odrive/utils.py index f5ce0c7f..2b2901a7 100755 --- a/tools/odrive/utils.py +++ b/tools/odrive/utils.py @@ -50,11 +50,15 @@ def dump_errors(odrv, clear=False): for name, remote_obj, errorcodes in module_decode_map: prefix = ' '*2 + name + ": " if (remote_obj.error != errorcodes.ERROR_NONE): + foundError = False print(prefix + _VT100Colors['red'] + "Error(s):" + _VT100Colors['default']) errorcodes_tup = [(name, val) for name, val in errorcodes.__dict__.items() if 'ERROR_' in name] for codename, codeval in errorcodes_tup: if remote_obj.error & codeval != 0: + foundError = True print(" " + codename) + if not foundError: + print(" " + 'UNKNOWN ERROR!') if clear: remote_obj.error = errorcodes.ERROR_NONE else: