From 884ac664dfe74dff464fa843737a3be62a16282d Mon Sep 17 00:00:00 2001 From: dan9186 Date: Thu, 9 Apr 2026 09:23:04 -0700 Subject: [PATCH] stop log from swallowing errors --- client/repos/log.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/repos/log.go b/client/repos/log.go index 14493db..335d8d8 100644 --- a/client/repos/log.go +++ b/client/repos/log.go @@ -3,6 +3,7 @@ package repos import ( "bytes" "context" + "errors" "fmt" "os/exec" "strings" @@ -24,6 +25,8 @@ func (r *Repos) LogRepos(ctx context.Context, dirs []string, ignoreEmpty bool, a defer r.scrb.EndDescribe() } + var errs []error + for _, dir := range dirs { out := &bytes.Buffer{} errout := &bytes.Buffer{} @@ -43,6 +46,7 @@ func (r *Repos) LogRepos(ctx context.Context, dirs []string, ignoreEmpty bool, a if err != nil { r.scrb.Error(err) r.scrb.PrintLines(errout) + errs = append(errs, fmt.Errorf("%s: %w", dir, err)) } else { r.scrb.PrintLines(out) } @@ -50,5 +54,5 @@ func (r *Repos) LogRepos(ctx context.Context, dirs []string, ignoreEmpty bool, a r.scrb.EndDescribe() } - return nil + return errors.Join(errs...) }