diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2011-09-26 03:05:35 +0200 |
---|---|---|
committer | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2011-09-30 13:58:03 +0200 |
commit | b6a01735d238733ef78f941a8b7c4bad59db2734 (patch) | |
tree | e3fc127dc19ad42c04564a5a674673cbf9038117 /bindings/python/notmuch/__init__.py | |
parent | a378a91ba2db58608640cd58373565d653a7c4e6 (diff) |
python: provide more exception classes
To make the exception handling more effective in code using the
python bindings it is necessary to differentiate between the
different kind of failures.
Add an exception class for each status code and add a decode
classmethod to the NotmuchError class that acts as a factory.
Import the new classes in __init__.py so they can be easily
imported by anyone.
Patch modifed by Sebastian Spaeth.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Diffstat (limited to 'bindings/python/notmuch/__init__.py')
-rw-r--r-- | bindings/python/notmuch/__init__.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/bindings/python/notmuch/__init__.py b/bindings/python/notmuch/__init__.py index a7b558f..36e5fc7 100644 --- a/bindings/python/notmuch/__init__.py +++ b/bindings/python/notmuch/__init__.py @@ -50,13 +50,28 @@ for more details. You should have received a copy of the GNU General Public License along with notmuch. If not, see <http://www.gnu.org/licenses/>. -Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>' +Copyright 2010-2011 Sebastian Spaeth <Sebastian@SSpaeth.de> """ from notmuch.database import Database, Query from notmuch.message import Messages, Message from notmuch.thread import Threads, Thread from notmuch.tag import Tags -from notmuch.globals import nmlib, STATUS, NotmuchError +from notmuch.globals import ( + nmlib, + STATUS, + NotmuchError, + OutOfMemoryError, + ReadOnlyDatabaseError, + XapianError, + FileError, + FileNotEmailError, + DuplicateMessageIdError, + NullPointerError, + TagTooLongError, + UnbalancedFreezeThawError, + UnbalancedAtomicError, + NotInitializedError +) from notmuch.version import __VERSION__ __LICENSE__ = "GPL v3+" __AUTHOR__ = 'Sebastian Spaeth <Sebastian@SSpaeth.de>' |