From 3a932dc4e26a7fd9ec5413de4fa3d1d048ee9ecd Mon Sep 17 00:00:00 2001 From: Niels Date: Fri, 9 Jun 2023 17:40:58 +0200 Subject: [PATCH] Add context information to error --- mg/deps.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mg/deps.go b/mg/deps.go index f0c2509b..67342b2f 100644 --- a/mg/deps.go +++ b/mg/deps.go @@ -107,14 +107,14 @@ func runDeps(ctx context.Context, fns []Fn) { } else { exit = changeExit(exit, 1) } - errs = append(errs, fmt.Sprint(v)) + errs = append(errs, fmt.Sprintf("%s: %v",fn.fn.Name(), v)) mu.Unlock() } wg.Done() }() if err := fn.run(ctx); err != nil { mu.Lock() - errs = append(errs, fmt.Sprint(err)) + errs = append(errs, fmt.Sprintf("%s: %v",fn.fn.Name(), err)) exit = changeExit(exit, ExitStatus(err)) mu.Unlock() }