X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=cnotmuch%2Fglobals.py;h=553670a49c5c1460a1c77c24ff3b144e5cf2a05a;hp=ff765167a7974ec0bd0ade1c102e128fbe920533;hb=55f1971437550aa382d0c2347a7be62dddcaa761;hpb=90c47567f4a165a62420a79da9a7f5b2ef8addce diff --git a/cnotmuch/globals.py b/cnotmuch/globals.py index ff765167..553670a4 100644 --- a/cnotmuch/globals.py +++ b/cnotmuch/globals.py @@ -14,7 +14,7 @@ class STATUS(object): NULL_POINTER = 7 TAG_TOO_LONG = 8 UNBALANCED_FREEZE_THAW = 9 - LAST_STATUS = 10 + NOT_INITIALIZED = 10 """Get a string representation of a notmuch_status_t value.""" status2str = nmlib.notmuch_status_to_string @@ -26,6 +26,9 @@ class STATUS(object): def __str__(self): """Get a string representation of a notmuch_status_t value.""" + # define strings for custom error messages + if self._status == STATUS.NOT_INITIALIZED: + return "Operation on uninitialized DB/MSG/THREAD impossible." return str(STATUS.status2str(self._status)) class NotmuchError(Exception):