unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: Gaute Hope <eg@gaute.vetsj.com>, notmuch <notmuch@notmuchmail.org>
Subject: Re: DatabaseModifiedErrors causing troubles
Date: Sat, 17 Jan 2015 13:29:31 +0100	[thread overview]
Message-ID: <87fvb9bnf8.fsf@maritornes.cs.unb.ca> (raw)
In-Reply-To: <1421493070-astroid-1-4x8pflg7mc-1327@strange>

Gaute Hope <eg@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

  reply	other threads:[~2015-01-17 12:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-11 12:17 DatabaseModifiedErrors causing troubles Gaute Hope
2014-08-21  8:59 ` Gaute Hope
2014-08-21  9:01   ` Gaute Hope
2014-12-31  8:28 ` David Bremner
2015-01-17 11:18   ` Gaute Hope
2015-01-17 12:29     ` David Bremner [this message]
2015-01-17 15:12       ` Gaute Hope

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fvb9bnf8.fsf@maritornes.cs.unb.ca \
    --to=david@tethera.net \
    --cc=eg@gaute.vetsj.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).