unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: guix-devel@gnu.org, Tobias Geerinckx-Rice <me@tobias.gr>
Subject: Re: 13/30: daemon: Print the line whence we expect an integer.
Date: Sun, 28 Nov 2021 18:13:27 +0100	[thread overview]
Message-ID: <87bl24b3uw.fsf@gnu.org> (raw)
In-Reply-To: <20211126235309.0983120983@vcs0.savannah.gnu.org> (guix-commits@gnu.org's message of "Fri, 26 Nov 2021 18:53:08 -0500 (EST)")

Hi Tobias!

guix-commits@gnu.org skribis:

> --- a/nix/libstore/local-store.cc
> +++ b/nix/libstore/local-store.cc
> @@ -839,7 +839,8 @@ template<class T> T LocalStore::getIntLineFromSubstituter(Agent & run)
>  {
>      string s = getLineFromSubstituter(run);
>      T res;
> -    if (!string2Int(s, res)) throw Error("integer expected from stream");
> +    if (!string2Int(s, res))
> +        throw Error(format("integer expected from stream: %1%") % s);

I would not print ‘s’ as-is because it could contain garbage, which in
turn could have undesirable side effects.

My 2¢,
Ludo’.


           reply	other threads:[~2021-11-28 17:14 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20211126235309.0983120983@vcs0.savannah.gnu.org>]

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://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bl24b3uw.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=me@tobias.gr \
    /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://git.savannah.gnu.org/cgit/guix.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).