aboutsummaryrefslogtreecommitdiff
path: root/bindings/python-cffi/notmuch2
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2021-01-03 08:30:46 -0400
committerDavid Bremner <david@tethera.net>2021-02-06 19:43:11 -0400
commiteea258c0c9386a5eecae48a98b552113a3584a7d (patch)
tree767f2ce98ff1e91bd892df17c633a264e1c9ea2a /bindings/python-cffi/notmuch2
parent1f860a6c41aad8b6d2350c439b39aa0692597a79 (diff)
lib: add NOTMUCH_STATUS_NO_CONFIG
This will allow client code to provide more meaningful diagnostics. In particular it will enable "notmuch new" to continue suggsting the user run "notmuch setup" to create a config after "notmuch new" is transitioned to the new configuration framework.
Diffstat (limited to 'bindings/python-cffi/notmuch2')
-rw-r--r--bindings/python-cffi/notmuch2/_build.py1
-rw-r--r--bindings/python-cffi/notmuch2/_errors.py4
2 files changed, 4 insertions, 1 deletions
diff --git a/bindings/python-cffi/notmuch2/_build.py b/bindings/python-cffi/notmuch2/_build.py
index d3bb9104..93828627 100644
--- a/bindings/python-cffi/notmuch2/_build.py
+++ b/bindings/python-cffi/notmuch2/_build.py
@@ -50,6 +50,7 @@ ffibuilder.cdef(
NOTMUCH_STATUS_MALFORMED_CRYPTO_PROTOCOL,
NOTMUCH_STATUS_FAILED_CRYPTO_CONTEXT_CREATION,
NOTMUCH_STATUS_UNKNOWN_CRYPTO_PROTOCOL,
+ NOTMUCH_STATUS_NO_CONFIG,
NOTMUCH_STATUS_LAST_STATUS
} notmuch_status_t;
typedef enum {
diff --git a/bindings/python-cffi/notmuch2/_errors.py b/bindings/python-cffi/notmuch2/_errors.py
index 13369445..c97d99cb 100644
--- a/bindings/python-cffi/notmuch2/_errors.py
+++ b/bindings/python-cffi/notmuch2/_errors.py
@@ -50,6 +50,8 @@ class NotmuchError(Exception):
PathError,
capi.lib.NOTMUCH_STATUS_ILLEGAL_ARGUMENT:
IllegalArgumentError,
+ capi.lib.NOTMUCH_STATUS_NO_CONFIG:
+ NoConfigError,
}
return types[status]
@@ -94,7 +96,7 @@ class UnsupportedOperationError(NotmuchError): pass
class UpgradeRequiredError(NotmuchError): pass
class PathError(NotmuchError): pass
class IllegalArgumentError(NotmuchError): pass
-
+class NoConfigError(NotmuchError): pass
class ObjectDestroyedError(NotmuchError):
"""The object has already been destroyed and it's memory freed.