Commit 2c0e634e by devttys0

Changed how plugin exceptions are handled/reported.

parent 0f6db187
...@@ -183,12 +183,13 @@ class Plugins(object): ...@@ -183,12 +183,13 @@ class Plugins(object):
plugins[key]['modules'].append(module) plugins[key]['modules'].append(module)
except KeyboardInterrupt as e: except KeyboardInterrupt as e:
raise e raise e
except Exception as e:
# Python files in the plugins directory that are not # Python files in the plugins directory that are not
# actually binwalk plugins will generate a TypeError # actually binwalk plugins will generate a TypeError
# about converting an object to a string implicitly. # about converting an object to a string implicitly.
# Don't need to warn about these. # Don't need to warn about these.
if not str(e).endswith('object to str implicitly'): except TypeError:
pass
except Exception as e:
binwalk.core.common.warning("Error loading plugin '%s': %s" % (file_name, str(e))) binwalk.core.common.warning("Error loading plugin '%s': %s" % (file_name, str(e)))
plugins[key]['enabled'][module] = False plugins[key]['enabled'][module] = False
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment