aboutsummaryrefslogtreecommitdiff
path: root/bindings
diff options
context:
space:
mode:
Diffstat (limited to 'bindings')
-rw-r--r--bindings/python/notmuch/globals.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bindings/python/notmuch/globals.py b/bindings/python/notmuch/globals.py
index 2a57c41..097ab96 100644
--- a/bindings/python/notmuch/globals.py
+++ b/bindings/python/notmuch/globals.py
@@ -99,8 +99,10 @@ class NotmuchError(Exception):
def __str__(self):
if self.message is not None:
return self.message
- else:
+ elif self.status is not None:
return STATUS.status2str(self.status)
+ else:
+ return 'Unknown error'
def _str(value):
"""Ensure a nicely utf-8 encoded string to pass to libnotmuch