diff options
| author | David Bremner <david@tethera.net> | 2022-01-10 10:54:03 -0400 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2022-01-10 10:54:03 -0400 |
| commit | 1b58ea1e66997efdd7ea2a7a83f76890de40fe04 (patch) | |
| tree | 7db3d1aedaf2ae8e1ff0851ff8c56658273d074e /bindings/python-cffi/notmuch2/_errors.py | |
| parent | 235b876793ec885b78c7b31904fd69d1a82fbe4a (diff) | |
| parent | 2394ee6289a2fc2628f198b4a9920116148dd814 (diff) | |
Merge tag 'debian/0.34.2-1' into debian/bullseye-backports
notmuch release 0.34.2-1 for unstable (sid) [dgit]
[dgit distro=debian no-split --quilt=linear]
Diffstat (limited to 'bindings/python-cffi/notmuch2/_errors.py')
| -rw-r--r-- | bindings/python-cffi/notmuch2/_errors.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bindings/python-cffi/notmuch2/_errors.py b/bindings/python-cffi/notmuch2/_errors.py index 9301073e..17c3ad9c 100644 --- a/bindings/python-cffi/notmuch2/_errors.py +++ b/bindings/python-cffi/notmuch2/_errors.py @@ -56,6 +56,8 @@ class NotmuchError(Exception): NoDatabaseError, capi.lib.NOTMUCH_STATUS_DATABASE_EXISTS: DatabaseExistsError, + capi.lib.NOTMUCH_STATUS_BAD_QUERY_SYNTAX: + QuerySyntaxError, } return types[status] @@ -81,7 +83,8 @@ class NotmuchError(Exception): if self.message: return self.message elif self.status: - return capi.lib.notmuch_status_to_string(self.status) + char_str = capi.lib.notmuch_status_to_string(self.status) + return capi.ffi.string(char_str).decode(errors='replace') else: return 'Unknown error' @@ -103,6 +106,7 @@ class IllegalArgumentError(NotmuchError): pass class NoConfigError(NotmuchError): pass class NoDatabaseError(NotmuchError): pass class DatabaseExistsError(NotmuchError): pass +class QuerySyntaxError(NotmuchError): pass class ObjectDestroyedError(NotmuchError): """The object has already been destroyed and it's memory freed. |
