]> git.cworth.org Git - obsolete/notmuch-old/blobdiff - bindings/python/notmuch/globals.py
python: Set status in the class definitions
[obsolete/notmuch-old] / bindings / python / notmuch / globals.py
index a42f2a40d68f4217d9f29691d44eb9b8ac8ef97b..de1db1617ae26a705c62caa457e7eea3b02943f1 100644 (file)
@@ -143,31 +143,32 @@ class NotmuchError(Exception):
 # List of Subclassed exceptions that correspond to STATUS values and are
 # subclasses of NotmuchError.
 class OutOfMemoryError(NotmuchError):
-    pass
+    status = STATUS.OUT_OF_MEMORY
 class ReadOnlyDatabaseError(NotmuchError):
-    pass
+    status = STATUS.READ_ONLY_DATABASE
 class XapianError(NotmuchError):
-    pass
+    status = STATUS.XAPIAN_EXCEPTION
 class FileError(NotmuchError):
-    pass
+    status = STATUS.FILE_ERROR
 class FileNotEmailError(NotmuchError):
-    pass
+    status = STATUS.FILE_NOT_EMAIL
 class DuplicateMessageIdError(NotmuchError):
-    pass
+    status = STATUS.DUPLICATE_MESSAGE_ID
 class NullPointerError(NotmuchError):
-    pass
+    status = STATUS.NULL_POINTER
 class TagTooLongError(NotmuchError):
-    pass
+    status = STATUS.TAG_TOO_LONG
 class UnbalancedFreezeThawError(NotmuchError):
-    pass
+    status = STATUS.UNBALANCED_FREEZE_THAW
 class UnbalancedAtomicError(NotmuchError):
-    pass
+    status = STATUS.UNBALANCED_ATOMIC
 class NotInitializedError(NotmuchError):
     """Derived from NotmuchError, this occurs if the underlying data
     structure (e.g. database is not initialized (yet) or an iterator has
     been exhausted. You can test for NotmuchError with .status =
     STATUS.NOT_INITIALIZED"""
-    pass
+    status = STATUS.NOT_INITIALIZED
+
 
 
 def _str(value):