| Age | Commit message (Collapse) | Author |
|
In order for a database to actually be writeable, it must be the case that it
is open, not just the correct type of Xapian object. By explicitely
checking, we are able to provide better error reporting, in particular
for the previously broken test in T566-lib-message.
|
|
We need to do it some day, and it is a bit annoying to read
deprecation messages in broken tests.
|
|
These cause failures when building out of tree.
|
|
This removes some redudant includes, and will also make it easier to
introduce "#define _GNU_SOURCE", which must come before all system
includes.
|
|
The extra space is mainly just untidy.
|
|
Initially document the intended API and copy the code from
notmuch_database_open_verbose. Most of the documented functionality is
not there yet.
|
|
The main goal is to allow configuration information to be temporarily
overridden by a separate config file. That will require further
changes not in this commit.
The performance impact is unclear, and will depend on the balance
between number of queries and number of distinct metadata items read
on the first call to n_d_get_config.
|
|
Fix a copy paste error of using the boolean ret as a notmuch_status_t,
and uninitialized.
|
|
The main criteria is that they don't crash. Working with a closed
database is a bonus.
|
|
This is a rare and probably serious programming error, so better not
to silently return a default value.
|
|
Xapian exceptions are swallowed and turned into default return value.
|
|
The catch block either needs to return, or the function needs to
return "status". Choose the latter for consistency with
n_d_get_config.
|
|
Error status is currently lost.
|
|
Xapian exceptions seem to handled OK, at least for this case.
|
|
Existing error handling seems adequate, if not ideal.
|
|
At least this Xapian exception is caught. Make sure it stays that way.
|
|
The error message and name were confusing when called in some "read
only" context.
|
|
The current error message is a bit confusing; fix in next commit.
|
|
The API docs promise to handle relative filenames, but the code did
not do it.
Also check for files outside the mail root, as implied by the API
description.
This fixes the bug reported at
id:87sgdqo0rz.fsf@tethera.net
|
|
The current code seems to look for the path relative to the current
working directory, rather than the mail store root.
|
|
Current exception handling seems OK, at least for this case.
|
|
At least this exception is already handled correctly.
|
|
This function only accesses data cached by notmuch, so being closed is
not a problem.
|
|
Xapian currently succeeds to begin/end a transaction on a closed database,
or at least does not throw an exception. Make the test robust against
this changing.
|
|
The logic is that if it's acceptable to return SUCCESS for read only
database, it's acceptable for a closed one.
|
|
Also clarify documentation of error return from n_d_needs_upgrade.
|
|
It's a bit arbitrary which value to return for errors, but the same
argument as for read only databases applies for errors.
|
|
Either an open or closed database should be ok to destroy
|
|
This does not currently throw an error, and it should stay that way.
|
|
notmuch_database_get_version previously returned 0 on some errors, but
did not document this. Luckily 0 is not a valid database version.
|
|
This should not crash, but it does currently.
|
|
These do not crash on a closed database, and we want to keep it that
way.
Start a new file of tests as T560-lib-error was starting to get unwieldy.
|