mirror of
https://git.notmuchmail.org/git/notmuch
synced 2025-01-03 15:21:41 +01:00
python: fix NotmuchError.__str__ if status == None
Passing None to STATUS.status2str raises an ArgumentError. Add a check for this case and provide a generic message. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
This commit is contained in:
parent
fc2d353eeb
commit
c16e47fe23
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue