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

Excerpts from David Bremner's message of December 31, 2014 9:28:
> Gaute Hope <eg@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@tethera.net
> 
> In particular id:1419788030-10567-6-git-send-email-david@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@tethera.net
> 
> Let me know what you think,
> 
> David
> 

  reply	other threads:[~2015-01-17 11:17 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 [this message]
2015-01-17 12:29     ` David Bremner
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=1421493070-astroid-1-4x8pflg7mc-1327@strange \
    --to=eg@gaute.vetsj.com \
    --cc=david@tethera.net \
    --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).