From d741dfe26d3493d262b610634d833dc715bfa70a Mon Sep 17 00:00:00 2001 From: Marcello Sylvester Bauer Date: Sat, 7 Oct 2023 15:01:57 -0700 Subject: [PATCH] fix(precondition): do not print error if context was aborted (#1338) --- precondition.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/precondition.go b/precondition.go index 35481ece..f4e69e6d 100644 --- a/precondition.go +++ b/precondition.go @@ -21,7 +21,9 @@ func (e *Executor) areTaskPreconditionsMet(ctx context.Context, t *taskfile.Task Env: env.Get(t), }) if err != nil { - e.Logger.Errf(logger.Magenta, "task: %s\n", p.Msg) + if !errors.Is(err, context.Canceled) { + e.Logger.Errf(logger.Magenta, "task: %s\n", p.Msg) + } return false, ErrPreconditionFailed } }