diff options
| author | David Bremner <david@tethera.net> | 2020-07-05 10:00:21 -0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2020-07-14 07:31:37 -0300 |
| commit | 96befd0dd075c5d3a63902d72eff7fc1928ba541 (patch) | |
| tree | f0d76277982e611759b01100eac9bc0c830f3a52 /lib/message.cc | |
| parent | 6dc62d8bea7ce537ba30e7f68061a27f03e0bda7 (diff) | |
lib: catch Xapian exceptions in n_m_count_files
This will require some care for the caller to check the sign, and not
just add error returns into a running total.
Diffstat (limited to 'lib/message.cc')
| -rw-r--r-- | lib/message.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/message.cc b/lib/message.cc index 364cdc9d..7713050a 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -1156,7 +1156,12 @@ notmuch_message_get_filenames (notmuch_message_t *message) int notmuch_message_count_files (notmuch_message_t *message) { - _notmuch_message_ensure_filename_list (message); + try { + _notmuch_message_ensure_filename_list (message); + } catch (Xapian::Error &error) { + LOG_XAPIAN_EXCEPTION (message, error); + return -1; + } return _notmuch_string_list_length (message->filename_list); } |
