[PATCH v2 3/8] show: Allow formatters to return errors
Austin Clements
amdragon at MIT.EDU
Sun Mar 11 16:34:08 PDT 2012
On Tue, 06 Mar 2012 21:22:55 +0000, Mark Walters <markwalters1009 at gmail.com> wrote:
> On Tue, 6 Mar 2012 18:48:39 +0000, Austin Clements <amdragon at 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 at 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
>
More information about the notmuch
mailing list