diff --git a/flow/tasker/tasker.go b/flow/tasker/tasker.go index 1291b3058..b82d0d674 100644 --- a/flow/tasker/tasker.go +++ b/flow/tasker/tasker.go @@ -150,7 +150,7 @@ func makeTask(ctx *flowctx.Context, node *hof.Node[any]) (cueflow.Runner, error) } if rerr != nil { - err = fmt.Errorf("in %q\n%v\n%+v", c.Value.Path(), cuetils.ExpandCueError(err), value) + rerr = fmt.Errorf("in %q\n%v\n%+v", c.Value.Path(), cuetils.ExpandCueError(rerr), value) // fmt.Println("RunnerRunc Error:", err) c.Error = rerr bt.Error = rerr diff --git a/flow/testdata/tasks/os/flow.cue b/flow/testdata/tasks/os/flow.cue new file mode 100644 index 000000000..1914c9938 --- /dev/null +++ b/flow/testdata/tasks/os/flow.cue @@ -0,0 +1,5 @@ +tasks: { + @flow() + r: { filename: "in.txt", contents: string } @task(os.ReadFile) +} + diff --git a/flow/testdata/tasks/os/golden.stdout b/flow/testdata/tasks/os/golden.stdout new file mode 100644 index 000000000..1154b56e7 --- /dev/null +++ b/flow/testdata/tasks/os/golden.stdout @@ -0,0 +1,6 @@ +Error in tasks | tasks: task failed: in "r" +open in.txt: no such file or directory + + + +1 error(s) were encountered diff --git a/flow/testdata/tasks/os/readfile_003.txt b/flow/testdata/tasks/os/readfile_003.txt index b8536ebf9..6f2d3836e 100644 --- a/flow/testdata/tasks/os/readfile_003.txt +++ b/flow/testdata/tasks/os/readfile_003.txt @@ -11,4 +11,6 @@ tasks: { Error in tasks | tasks: task failed: in "r" open in.txt: no such file or directory + + 1 error(s) were encountered