diff options
Diffstat (limited to 'pyeclib/ec_iface.py')
-rw-r--r-- | pyeclib/ec_iface.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pyeclib/ec_iface.py b/pyeclib/ec_iface.py index fbe82f0..4785d18 100644 --- a/pyeclib/ec_iface.py +++ b/pyeclib/ec_iface.py @@ -112,8 +112,12 @@ class PyECLib_FRAGHDRCHKSUM_Types(PyECLibEnum): # Generic ECDriverException class ECDriverError(Exception): - def __init__(self, error_str): - self.error_str = error_str + def __init__(self, error): + try: + self.error_str = str(error) + except TypeError: + self.error_str = 'Error retrieving the error message from %s' \ + % error.__class__.__name__ def __str__(self): return self.error_str |