]> git.notmuchmail.org Git - notmuch/blob - bindings/python/docs/source/status_and_errors.rst
Import notmuch_0.28.2.orig.tar.gz
[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 .. note::
9
10     Prior to version 0.12 the exception classes and the enumeration
11     :class:`notmuch.STATUS` were defined in `notmuch.globals`. They
12     have since then been moved into `notmuch.errors`.
13
14 :class:`STATUS` -- Notmuch operation return value
15 --------------------------------------------------
16
17 .. autoclass:: notmuch.STATUS
18    :inherited-members:
19
20 .. automethod:: notmuch.STATUS.status2str
21
22 :exc:`NotmuchError` -- A Notmuch execution error
23 ------------------------------------------------
24 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.
25
26 .. autoexception:: NotmuchError
27
28 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:
29
30 .. autoexception:: OutOfMemoryError(message=None)
31    :members:
32 .. autoexception:: ReadOnlyDatabaseError(message=None)
33    :members:
34 .. autoexception:: XapianError(message=None)
35    :members:
36 .. autoexception:: FileError(message=None)
37    :members:
38 .. autoexception:: FileNotEmailError(message=None)
39    :members:
40 .. autoexception:: DuplicateMessageIdError(message=None)
41    :members:
42 .. autoexception:: NullPointerError(message=None)
43    :members:
44 .. autoexception:: TagTooLongError(message=None)
45    :members:
46 .. autoexception:: UnbalancedFreezeThawError(message=None)
47    :members:
48 .. autoexception:: UnbalancedAtomicError(message=None)
49    :members:
50 .. autoexception:: UnsupportedOperationError(message=None)
51    :members:
52 .. autoexception:: UpgradeRequiredError(message=None)
53    :members:
54 .. autoexception:: PathError(message=None)
55    :members:
56 .. autoexception:: NotInitializedError(message=None)
57    :members: