unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Austin Clements <amdragon@MIT.EDU>
To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org
Subject: Re: [PATCH v2 3/8] show: Allow formatters to return errors
Date: Sun, 11 Mar 2012 19:34:08 -0400	[thread overview]
Message-ID: <87wr6qsoen.fsf@awakening.csail.mit.edu> (raw)
In-Reply-To: <87ipihbf0w.fsf@qmul.ac.uk>

On Tue, 06 Mar 2012 21:22:55 +0000, Mark Walters <markwalters1009@gmail.com> wrote:
> On Tue,  6 Mar 2012 18:48:39 +0000, Austin Clements <amdragon@MIT.EDU> wrote:
> > Formatter errors are propagated to the exit status of notmuch show.
> > 
> > This isn't used by the JSON or text formatters, but it will be useful
> > for the raw format, which is pickier.
> 
> I am not very familiar with this part of the code but the whole series
> looks fine to me.
> 
> My only minor comment is that I like Tom's suggestion (in
> id:"m2399qrtat.fsf@guru.guru-group.fi") of having NOTMUCH_STATUS_FAILURE
> (= 1) to make the error handling look cleaner. Alternatively (or

We could introduce a generic failure, though it couldn't be equal to 1
without breaking binary compatibility.  I'm not sure a generic failure
would make things much better, though; as far as I can tell, error
handling in C is doomed to ugliness.

> possibly as well) the functions do_show and do_show_messages could pass
> the actual error back up to notmuch_show_command and then that function
> could convert return 0/1 as appropriate.

I would be happy to be convinced either way.  It's the way it is because
I didn't bother changing it and because I think it's reasonable to think
of do_show and do_show_messages as extensions of notmuch_show_command.

> As usual I am quite happy to be overruled!
> 
> Best wishes
> 
> Mark
> 

  parent reply	other threads:[~2012-03-11 23:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-03  5:20 [PATCH 0/5] Rewrite mbox and raw show formats Austin Clements
2012-03-03  5:20 ` [PATCH 1/5] show: Allow formatters to return errors Austin Clements
2012-03-03  5:20 ` [PATCH 2/5] show: Move format_message_mbox with the other new-style formats Austin Clements
2012-03-03  5:20 ` [PATCH 3/5] show: Convert mbox format to new self-recursive style Austin Clements
2012-03-03  5:20 ` [PATCH 4/5] show: Move format_part_content_raw with the other new-style formats Austin Clements
2012-03-03  5:20 ` [PATCH 5/5] show: Convert raw format to the new self-recursive style Austin Clements
2012-03-03 22:05   ` Jameson Graef Rollins
2012-03-06 18:43     ` Austin Clements
2012-03-03  8:18 ` [PATCH 0/5] Rewrite mbox and raw show formats Tomi Ollila
2012-03-06 18:48 ` [PATCH v2 0/8] " Austin Clements
2012-03-06 18:48   ` [PATCH v2 1/8] test: Fix typo in test description Austin Clements
2012-03-06 18:48   ` [PATCH v2 2/8] test: Fix malformed multipart message Austin Clements
2012-03-06 18:48   ` [PATCH v2 3/8] show: Allow formatters to return errors Austin Clements
2012-03-06 21:22     ` Mark Walters
2012-03-07 20:18       ` Tomi Ollila
2012-03-11 23:34       ` Austin Clements [this message]
2012-03-06 18:48   ` [PATCH v2 4/8] show: Move format_message_mbox with the other new-style formats Austin Clements
2012-03-06 18:48   ` [PATCH v2 5/8] show: Convert mbox format to new self-recursive style Austin Clements
2012-03-06 18:48   ` [PATCH v2 6/8] show: Move format_part_content_raw with the other new-style formats Austin Clements
2012-03-06 18:48   ` [PATCH v2 7/8] show: Convert raw format to the new self-recursive style, properly support interior parts Austin Clements
2012-03-06 18:48   ` [PATCH v2 8/8] man: Update raw format documentation Austin Clements
2012-03-09  3:25   ` [PATCH v2 0/8] Rewrite mbox and raw show formats Adam Wolfe Gordon
2012-03-18 12:51   ` David Bremner

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=87wr6qsoen.fsf@awakening.csail.mit.edu \
    --to=amdragon@mit.edu \
    --cc=markwalters1009@gmail.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).