* Re: 13/30: daemon: Print the line whence we expect an integer.
[not found] ` <20211126235309.0983120983@vcs0.savannah.gnu.org>
@ 2021-11-28 17:13 ` Ludovic Courtès
0 siblings, 0 replies; only message in thread
From: Ludovic Courtès @ 2021-11-28 17:13 UTC (permalink / raw)
To: guix-devel, Tobias Geerinckx-Rice
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’.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-11-28 17:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20211126235303.14269.45736@vcs0.savannah.gnu.org>
[not found] ` <20211126235309.0983120983@vcs0.savannah.gnu.org>
2021-11-28 17:13 ` 13/30: daemon: Print the line whence we expect an integer Ludovic Courtès
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).