summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bindings/python/lang.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bindings/python/lang.py b/bindings/python/lang.py
index 4c3d7cc5..72c2911c 100644
--- a/bindings/python/lang.py
+++ b/bindings/python/lang.py
@@ -168,7 +168,10 @@ class Error(Exception):
raise exception
def __str__(self):
- return '<lasso.%s(%s): %s>' % (self.__class__.__name__, self.code, _lasso.strError(self.code))
+ if self.code:
+ return '<lasso.%s(%s): %s>' % (self.__class__.__name__, self.code, _lasso.strError(self.code))
+ else:
+ return '<lasso.%s: %s>' % (self.__class__.__name__, self.message)
def __getitem__(self, i):
# compatibility with SWIG bindings