1
0
mirror of https://github.com/go-task/task.git synced 2025-11-23 22:24:45 +02:00

Allow ignore_error at task level

This commit is contained in:
Andrey Nering
2018-08-05 12:53:42 -03:00
parent c70343a5bc
commit feaf70922d
5 changed files with 63 additions and 26 deletions

View File

@@ -182,6 +182,12 @@ func (e *Executor) RunTask(ctx context.Context, call taskfile.Call) error {
if err2 := statusOnError(t); err2 != nil {
e.Logger.VerboseErrf("task: error cleaning status on error: %v", err2)
}
if _, ok := err.(interp.ExitCode); ok && t.IgnoreError {
e.Logger.VerboseErrf("task: task error ignored: %v", err)
continue
}
return &taskRunError{t.Task, err}
}
}