X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=bindings%2Fpython%2Fnotmuch%2Fglobals.py;h=097ab96800d1dcaa3336f037605be61561b1d0fd;hb=c16e47fe23901951399c9c463e82292a36462b73;hp=2a57c411f3b6c4a07f61ec069c59397efe928059;hpb=fc2d353eeb074f3659df3ad60720d119480ab192;p=obsolete%2Fnotmuch-old diff --git a/bindings/python/notmuch/globals.py b/bindings/python/notmuch/globals.py index 2a57c411..097ab968 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