aboutsummaryrefslogtreecommitdiff
path: root/bindings/python
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2016-02-10 11:53:46 -0500
committerJustus Winter <4winter@informatik.uni-hamburg.de>2016-02-11 20:41:54 +0100
commitfa0bc2ef91cf5c5a86ac24cd76383be3b1819cee (patch)
tree614d8bbcfc9f1a47e9bdefe6a17b7a3baeb7fc13 /bindings/python
parent1fcbf095828dc91423f61a290887fe244750bf8a (diff)
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.
Diffstat (limited to 'bindings/python')
-rw-r--r--bindings/python/notmuch/database.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py
index 93e7b7a1..f3045334 100644
--- a/bindings/python/notmuch/database.py
+++ b/bindings/python/notmuch/database.py
@@ -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