There are various locations where exceptions are constructed but
not raised. This patch adds the necessary raise statements.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
# create query, return None if too little mem available
query_p = Query._create(db.db_p, _str(querystr))
if query_p is None:
# create query, return None if too little mem available
query_p = Query._create(db.db_p, _str(querystr))
if query_p is None:
- NotmuchError(STATUS.NULL_POINTER)
+ raise NotmuchError(STATUS.NULL_POINTER)
self._query = query_p
def set_sort(self, sort):
self._query = query_p
def set_sort(self, sort):
msgs_p = Query._search_messages(self._query)
if msgs_p is None:
msgs_p = Query._search_messages(self._query)
if msgs_p is None:
- NotmuchError(STATUS.NULL_POINTER)
+ raise NotmuchError(STATUS.NULL_POINTER)
return Messages(msgs_p, self)
return Messages(msgs_p, self)
once all derived objects are dead.
"""
if files_p is None:
once all derived objects are dead.
"""
if files_p is None:
- NotmuchError(STATUS.NULL_POINTER)
+ raise NotmuchError(STATUS.NULL_POINTER)
self._files = files_p
#save reference to parent object so we keep it alive
self._files = files_p
#save reference to parent object so we keep it alive
the Python object.(?)
"""
if msgs_p is None:
the Python object.(?)
"""
if msgs_p is None:
- NotmuchError(STATUS.NULL_POINTER)
+ raise NotmuchError(STATUS.NULL_POINTER)
self._msgs = msgs_p
#store parent, so we keep them alive as long as self is alive
self._msgs = msgs_p
#store parent, so we keep them alive as long as self is alive
objects are dead.
"""
if msg_p is None:
objects are dead.
"""
if msg_p is None:
- NotmuchError(STATUS.NULL_POINTER)
+ raise NotmuchError(STATUS.NULL_POINTER)
self._msg = msg_p
#keep reference to parent, so we keep it alive
self._parent = parent
self._msg = msg_p
#keep reference to parent, so we keep it alive
self._parent = parent
cache the tags in the Python object(?)
"""
if tags_p is None:
cache the tags in the Python object(?)
"""
if tags_p is None:
- NotmuchError(STATUS.NULL_POINTER)
+ raise NotmuchError(STATUS.NULL_POINTER)
self._tags = tags_p
#save reference to parent object so we keep it alive
self._tags = tags_p
#save reference to parent object so we keep it alive
the Python object.(?)
"""
if threads_p is None:
the Python object.(?)
"""
if threads_p is None:
- NotmuchError(STATUS.NULL_POINTER)
+ raise NotmuchError(STATUS.NULL_POINTER)
self._threads = threads_p
#store parent, so we keep them alive as long as self is alive
self._threads = threads_p
#store parent, so we keep them alive as long as self is alive
objects are dead.
"""
if thread_p is None:
objects are dead.
"""
if thread_p is None:
- NotmuchError(STATUS.NULL_POINTER)
+ raise NotmuchError(STATUS.NULL_POINTER)
self._thread = thread_p
#keep reference to parent, so we keep it alive
self._parent = parent
self._thread = thread_p
#keep reference to parent, so we keep it alive
self._parent = parent
msgs_p = Thread._get_toplevel_messages(self._thread)
if msgs_p is None:
msgs_p = Thread._get_toplevel_messages(self._thread)
if msgs_p is None:
- NotmuchError(STATUS.NULL_POINTER)
+ raise NotmuchError(STATUS.NULL_POINTER)
return Messages(msgs_p, self)
return Messages(msgs_p, self)