DatabaseModifiedErrors causing troubles

Gaute Hope eg at gaute.vetsj.com
Sat Jan 17 03:18:43 PST 2015


Excerpts from David Bremner's message of December 31, 2014 9:28:
> Gaute Hope <eg at gaute.vetsj.com> 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
> 
>            id:1419788030-10567-2-git-send-email-david at tethera.net
> 
> In particular id:1419788030-10567-6-git-send-email-david at tethera.net
> replaces the printfs with saving to a status string accessible from
> notmuch_database_t.

Hi David,

Would it be possible with an error code that I could compare against in
stead? It would then work a bit like a global instance of the gmime
error. It could even be a preparation step against a gmime-error-style
solution in the far future.

I am sure you know all the bad reasons for using a strcmp with strings
such as small (subtle) changes making them useless or future
localization of notmuch. This solution is in my opinion worse than the
current situation, it will lock things in and create problems for future
API compatability and application maintainers. I would rather wait for
or spend some time on a more general solution.

Best regards, Gaute

> 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
> 
>    id:1419971380-10307-2-git-send-email-david at tethera.net
> 
> Let me know what you think,
> 
> David
> 


More information about the notmuch mailing list