Re: DatabaseModifiedErrors causing troubles

Subject: Re: DatabaseModifiedErrors causing troubles

Date: Wed, 31 Dec 2014 09:28:04 +0100

To: Gaute Hope, notmuch


From: David Bremner

Gaute Hope <> writes:

> I can work around this by checking for a NULL pointer returned from
> notmuch_query_search_threads () and re-open the database
> (notmuch_database_close () -> notmuch_database_open ()). But I have no
> way of knowing programatically if this really is the error that has
> happened. There should be some way of propagating the error
> information or (even better for my case; for notmuch to reopen the
> database), one option is the Gmime way of passing an pointer to an
> error structure that is filled up by the notmuch interface function.

Hi Gaute;

Sorry this sequence of postings of yours kindof fell down a well. In
general there seems to be not very much enthusiasm for the GError
solution.  We can do something less fancy with the series at


In particular
replaces the printfs with saving to a status string accessible from

I _think_ this could solve your problem, although doing strcmp on error
message might not be ideal. Overall this is much less api breakage
(only open and create need to be wrapped).

We could also consider really updating the api for those NULL returning
functions, but it seems less bad to me than the count functions updated
in this series

Let me know what you think,