Print a failed command's error once on stderr (closes #433)
check / check (push) Failing after 9m31s

A failed command printed its error twice on stderr: as an ERROR log record and as the final ERROR: line the README documents. The command handlers, a restore failure that ends the command and a failed blob upload now log that error at info level or not at all, so without --verbose or --debug only the final line appears.

Model: opus-5-5
This commit was merged in pull request #451.
This commit is contained in:
clawbot committed 2026-11-11 07:38:11 +01:00
1 parent 5f1f8c4f66
commit 6a8bb2f389
12 files changed
+247 -25

No files matched your search

+4
View File
@@ -85,6 +85,10 @@ func emitStartupBanner(args []string, w io.Writer) {
// 🛑 ERROR: format. Use it from goroutine error paths (where returning
// an error to cobra isn't an option) and anywhere else a CLI command
// must surface a failure outside the normal RunE return path.
//
// This line is the one report of the failure. A caller that also logs
// the failure logs it at info level, so the record appears only under
// --verbose or --debug and the error is not printed twice.
func ReportErrorf(format string, args ...any) {
ui.New(os.Stderr).Errorf(format, args...)
}