(address . bug-guix@gnu.org)
In the guix/scripts/system.scm file we do not check the value while parsing the flag:
Toggle snippet (6 lines)
(option '("on-error") #t #f
(lambda (opt name arg result)
(alist-cons 'on-error (string->symbol arg)
result)))
and then blindly pass it to load*:
Toggle snippet (4 lines)
(load* file %user-module
#:on-error (assoc-ref opts 'on-error))
and load* uses it in a case that only gets called when an actual error occurs and treats the correct symbols but has a default clause that silently ignores values other than debug and backtrace:
Toggle snippet (9 lines)
(case on-error
((debug)
...)
((backtrace)
...)
(else
#t))
meaning that for example a typo such as `--on-error=stacktrace`, gets treated as if the flag was not passed at all.
Minimum replication:
Toggle snippet (4 lines)
guix system build <(echo x) --on-error=stacktrace
guix system build <(echo x) --on-error=backtrace
I'm not sure where the check should be done, nor what would be an acceptable way to not duplicate the list of valid values between guix/ui.scm and guix/scripts/system.scm