Re: [PATCH 2/3] CLI: exit with error when load_config returns and error.

Subject: Re: [PATCH 2/3] CLI: exit with error when load_config returns and error.

Date: Wed, 13 Sep 2023 08:37:21 -0500

To: David Bremner

Cc: notmuch@notmuchmail.org

From: Eric Blake


On Tue, Sep 12, 2023 at 09:56:35PM -0300, David Bremner wrote:

In the subject: s/and/an/

> ---
>  notmuch.c           | 2 ++
>  test/T030-config.sh | 1 -
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/notmuch.c b/notmuch.c
> index 37286b8f..43554530 100644
> --- a/notmuch.c
> +++ b/notmuch.c
> @@ -584,6 +584,8 @@ main (int argc, char *argv[])
>  	case NOTMUCH_STATUS_SUCCESS:
>  	    break;
>  	default:
> +	    fputs("error loading config file\n", stderr);
> +	    ret = 1;
>  	    goto DONE;
>  	}
>  
> diff --git a/test/T030-config.sh b/test/T030-config.sh
> index 6ef759a4..8b3ef436 100755
> --- a/test/T030-config.sh
> +++ b/test/T030-config.sh
> @@ -196,7 +196,6 @@ output=$(notmuch config get built_with.nonexistent)
>  test_expect_equal "$output" "false"
>  
>  test_begin_subtest "Bad utf8 reported as error"
> -test_subtest_known_broken
>  cp initial-config bad-config
>  printf '[query]\nq3=from:\xff\n' >>bad-config
>  test_expect_code 1 "notmuch --config=./bad-config config list"

Definite progress!  It doesn't say what the precise error is, but
calling out the config file as the problem is far better than silence.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org

_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: