summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5e75398)
Technically, this is a superfluous change, as the self.status variable
currently gets set in NotmuchErrors's __new__ function. However, in the
long run I would like to get rid of the weird __new__ implementation which
might be somewhat confusing for users (NotmuchError(status) returns a
different class, e.g. OutOfMemoryError)
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
# List of Subclassed exceptions that correspond to STATUS values and are
# subclasses of NotmuchError.
class OutOfMemoryError(NotmuchError):
# List of Subclassed exceptions that correspond to STATUS values and are
# subclasses of NotmuchError.
class OutOfMemoryError(NotmuchError):
+ status = STATUS.OUT_OF_MEMORY
class ReadOnlyDatabaseError(NotmuchError):
class ReadOnlyDatabaseError(NotmuchError):
+ status = STATUS.READ_ONLY_DATABASE
class XapianError(NotmuchError):
class XapianError(NotmuchError):
+ status = STATUS.XAPIAN_EXCEPTION
class FileError(NotmuchError):
class FileError(NotmuchError):
+ status = STATUS.FILE_ERROR
class FileNotEmailError(NotmuchError):
class FileNotEmailError(NotmuchError):
+ status = STATUS.FILE_NOT_EMAIL
class DuplicateMessageIdError(NotmuchError):
class DuplicateMessageIdError(NotmuchError):
+ status = STATUS.DUPLICATE_MESSAGE_ID
class NullPointerError(NotmuchError):
class NullPointerError(NotmuchError):
+ status = STATUS.NULL_POINTER
class TagTooLongError(NotmuchError):
class TagTooLongError(NotmuchError):
+ status = STATUS.TAG_TOO_LONG
class UnbalancedFreezeThawError(NotmuchError):
class UnbalancedFreezeThawError(NotmuchError):
+ status = STATUS.UNBALANCED_FREEZE_THAW
class UnbalancedAtomicError(NotmuchError):
class UnbalancedAtomicError(NotmuchError):
+ 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"""
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"""
+ status = STATUS.NOT_INITIALIZED
+