GNU bug report logs -
#50982
[PATCH] scripts: home/system: Don’t throw an error if no generations exist.
Previous Next
Reported by: Xinglu Chen <public <at> yoctocell.xyz>
Date: Sat, 2 Oct 2021 21:06:02 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #17 received at 50982 <at> debbugs.gnu.org (full text, mbox):
Hi,
Xinglu Chen <public <at> yoctocell.xyz> skribis:
> On Sun, Oct 03 2021, Maxime Devos wrote:
>
>> Xinglu Chen schreef op za 02-10-2021 om 23:05 [+0200]:
>>> Previously, When running ‘guix home describe’ or ‘guix system describe’ prior
>>> to having any generations, a backtrace would produced. Since not having any
>>> existing generations is not an error, a warning would be enough.
>>>
>>> $ guix system describe
>>> guix system: warning: no system generation, nothing to describe
>>
>> Printing a warning instead of an error to avoid a backrace isn't necessary.
>> E.g., "guix show i-do-not-exists" prints an error
>> ‘guix show: error: i-do-not-exist: package not found’.
>>
>> I suggest using (leave (G_ "bla bla")) instead of (error (G_ "bla bla"))
>> for these kind of errors, it appears to work '%find-package' in (gnu packages).
>>
>> I don't know if the output of "guix system describe" and "guix home describe"
>> should be an error or warning here ...
>
> Hmm, since I don’t think that not having any generations is an error, I
> would say it makes more sense to use ‘warning’ instead of ‘leave’.
> ‘leave’ would signal that something isn’t correct, which makes sense if
> one runs ‘guix show doesnt-exist’, but not having any generations
> doesn’t really mean that something is wrong.
Yeah, I guess ‘warning’ is fine.
Maxime’s point is that we should always use procedures from (guix
diagnostics) for error/warning/info reports.
Thanks,
Ludo’.
This bug report was last modified 3 years and 191 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.