DatabaseModifiedErrors causing troubles

David Bremner david at tethera.net
Sat Jan 17 04:29:31 PST 2015


Gaute Hope <eg at gaute.vetsj.com> writes:

>
> 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.

I don't agree it's worse than the current situation but I take your
point it isn't ideal.  We could do some kind "errno" in the database
structure.  I think there are not that many functions with this
unhelpful error return type. Based on a scan of notmuch.h, I see

notmuch_query_search_threads
notmuch_query_search_messages

and the two count functions that I already posted API breaking patches
for.  It might be better just to update the API (either adding versions
with error returns, or just forcing people to change) for these
functions.  Otherwise we have two different ways of returning status
codes, and the "errno" is only used some of the time.

d



More information about the notmuch mailing list