From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Subject: [PATCH 2/2] cli/new: add better error messages for FILE_ERROR
Date: Tue, 29 Mar 2016 23:10:14 -0300 [thread overview]
Message-ID: <1459303814-31988-3-git-send-email-david@tethera.net> (raw)
In-Reply-To: <1459303814-31988-1-git-send-email-david@tethera.net>
The code in add_file seems to assume that NOTMUCH_STATUS_FILE_ERROR is
never returned from add_message. This turns out to be false (although it
seems to only happen in certain fairly rare race conditions).
---
notmuch-new.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/notmuch-new.c b/notmuch-new.c
index e503776..04cb5ca 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -281,6 +281,10 @@ add_file (notmuch_database_t *notmuch, const char *filename,
fprintf (stderr, "Note: Ignoring non-mail file: %s\n", filename);
break;
/* Fatal issues. Don't process anymore. */
+ case NOTMUCH_STATUS_FILE_ERROR:
+ fprintf (stderr, "Unexpected error with file %s\n", filename);
+ (void) print_status_database ("add_file", notmuch, status);
+ goto DONE;
case NOTMUCH_STATUS_READ_ONLY_DATABASE:
case NOTMUCH_STATUS_XAPIAN_EXCEPTION:
case NOTMUCH_STATUS_OUT_OF_MEMORY:
--
2.8.0.rc3
prev parent reply other threads:[~2016-03-30 2:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-30 2:10 handle NOTMUCH_STATUS_ERROR_MESSAGE David Bremner
2016-03-30 2:10 ` [PATCH 1/2] CLI: add print_status_database David Bremner
2016-03-30 20:50 ` Tomi Ollila
2016-03-31 1:34 ` David Bremner
2016-03-30 2:10 ` David Bremner [this message]
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=1459303814-31988-3-git-send-email-david@tethera.net \
--to=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).