mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 17:34:54 +01:00
5fddc07dc3
It has been a long-standing issue that notmuch_database_open doesn't return any indication of why it failed. This patch changes its prototype to return a notmuch_status_t and set an out-argument to the database itself, like other functions that return both a status and an object. In the interest of atomicity, this also updates every use in the CLI so that notmuch still compiles. Since this patch does not update the bindings, the Python bindings test fails.
18 lines
394 B
C++
18 lines
394 B
C++
#include <stdio.h>
|
|
#include <xapian.h>
|
|
#include <notmuch.h>
|
|
|
|
|
|
int main() {
|
|
notmuch_database_t *notmuch;
|
|
notmuch_database_open("fakedb", NOTMUCH_DATABASE_MODE_READ_ONLY, ¬much);
|
|
|
|
try {
|
|
(void) new Xapian::WritableDatabase("./nonexistant", Xapian::DB_OPEN);
|
|
} catch (const Xapian::Error &error) {
|
|
printf("caught %s\n", error.get_msg().c_str());
|
|
return 0;
|
|
}
|
|
|
|
return 1;
|
|
}
|