mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 09:24:54 +01:00
lib: add NOTMUCH_STATUS_DATABASE_EXISTS
It is desirable to distinguish between attempting to create a database that already exists, and more fatal errors like permission problems.
This commit is contained in:
parent
c447fe92c7
commit
55f5e87096
3 changed files with 8 additions and 0 deletions
|
@ -51,6 +51,7 @@ ffibuilder.cdef(
|
|||
NOTMUCH_STATUS_FAILED_CRYPTO_CONTEXT_CREATION,
|
||||
NOTMUCH_STATUS_UNKNOWN_CRYPTO_PROTOCOL,
|
||||
NOTMUCH_STATUS_NO_CONFIG,
|
||||
NOTMUCH_STATUS_DATABASE_EXISTS,
|
||||
NOTMUCH_STATUS_LAST_STATUS
|
||||
} notmuch_status_t;
|
||||
typedef enum {
|
||||
|
|
|
@ -52,6 +52,8 @@ class NotmuchError(Exception):
|
|||
IllegalArgumentError,
|
||||
capi.lib.NOTMUCH_STATUS_NO_CONFIG:
|
||||
NoConfigError,
|
||||
capi.lib.NOTMUCH_STATUS_DATABASE_EXISTS:
|
||||
DatabaseExistsError,
|
||||
}
|
||||
return types[status]
|
||||
|
||||
|
@ -97,6 +99,7 @@ class UpgradeRequiredError(NotmuchError): pass
|
|||
class PathError(NotmuchError): pass
|
||||
class IllegalArgumentError(NotmuchError): pass
|
||||
class NoConfigError(NotmuchError): pass
|
||||
class DatabaseExistsError(NotmuchError): pass
|
||||
|
||||
class ObjectDestroyedError(NotmuchError):
|
||||
"""The object has already been destroyed and it's memory freed.
|
||||
|
|
|
@ -212,6 +212,10 @@ typedef enum _notmuch_status {
|
|||
* Unable to load a config file
|
||||
*/
|
||||
NOTMUCH_STATUS_NO_CONFIG,
|
||||
/**
|
||||
* Database exists, so not (re)-created
|
||||
*/
|
||||
NOTMUCH_STATUS_DATABASE_EXISTS,
|
||||
/**
|
||||
* Not an actual status value. Just a way to find out how many
|
||||
* valid status values there are.
|
||||
|
|
Loading…
Reference in a new issue