mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 17:34:54 +01:00
notmuch.Database.remove_message should raise exception on failure
The notmuch python bindings document that database.remove_message should raise an exception when the message removal fails, but they don't actually do it.
This commit is contained in:
parent
1fcbf09582
commit
fa0bc2ef91
1 changed files with 4 additions and 1 deletions
|
@ -483,7 +483,10 @@ class Database(object):
|
|||
removed.
|
||||
"""
|
||||
self._assert_db_is_initialized()
|
||||
return self._remove_message(self._db, _str(filename))
|
||||
status = self._remove_message(self._db, _str(filename))
|
||||
if status not in [STATUS.SUCCESS, STATUS.DUPLICATE_MESSAGE_ID]:
|
||||
raise NotmuchError(status)
|
||||
return status
|
||||
|
||||
def find_message(self, msgid):
|
||||
"""Returns a :class:`Message` as identified by its message ID
|
||||
|
|
Loading…
Reference in a new issue