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>
def __str__(self):
if self.message is not None:
return self.message
def __str__(self):
if self.message is not None:
return self.message
+ elif self.status is not None:
return STATUS.status2str(self.status)
return STATUS.status2str(self.status)
+ else:
+ return 'Unknown error'
def _str(value):
"""Ensure a nicely utf-8 encoded string to pass to libnotmuch
def _str(value):
"""Ensure a nicely utf-8 encoded string to pass to libnotmuch