]> git.notmuchmail.org Git - notmuch/blob - bindings/python/docs/source/status_and_errors.rst
bc0d0d230fd98737e9334b57cee1b77fbac894ae
[notmuch] / bindings / python / docs / source / status_and_errors.rst
1 .. currentmodule:: notmuch
2
3 Status and Errors
4 =================
5
6 Some methods return a status, indicating if an operation was successful and what the error was. Most of these status codes are expressed as a specific value, the :class:`notmuch.STATUS`.
7
8 :class:`STATUS` -- Notmuch operation return value
9 --------------------------------------------------
10
11 .. autoclass:: notmuch.STATUS
12    :inherited-members:
13
14 .. automethod:: notmuch.STATUS.status2str
15
16 :exc:`NotmuchError` -- A Notmuch execution error
17 ------------------------------------------------
18 Whenever an error occurs, we throw a special Exception :exc:`NotmuchError`, or a more fine grained Exception which is derived from it. This means it is always safe to check for NotmuchErrors if you want to catch all errors. If you are interested in more fine grained exceptions, you can use those below.
19
20 .. autoexception:: NotmuchError
21
22 The following exceptions are all directly derived from NotmuchError. Each of them corresponds to a specific :class:`notmuch.STATUS` value. You can either check the :attr:`status` attribute of a NotmuchError to see if a specific error has occurred, or you can directly check for the following Exception types:
23
24 .. autoexception:: OutOfMemoryError(message=None)
25    :members:
26 .. autoexception:: ReadOnlyDatabaseError(message=None)
27    :members:
28 .. autoexception:: XapianError(message=None)
29    :members:
30 .. autoexception:: FileError(message=None)
31    :members:
32 .. autoexception:: FileNotEmailError(message=None)
33    :members:
34 .. autoexception:: DuplicateMessageIdError(message=None)
35    :members:
36 .. autoexception:: NullPointerError(message=None)
37    :members:
38 .. autoexception:: TagTooLongError(message=None)
39    :members:
40 .. autoexception:: UnbalancedFreezeThawError(message=None)
41    :members:
42 .. autoexception:: UnbalancedAtomicError(message=None)
43    :members:
44 .. autoexception:: NotInitializedError(message=None)
45    :members: