go-floc icon indicating copy to clipboard operation
go-floc copied to clipboard

How can i handle multiple errors from Parallel execution

Open Kirhchoff opened this issue 8 months ago • 3 comments

I can't seem to figure out how to handle multiple errors occurring in parallel.

func fail(msg string) floc.Job {
	return func(ctx floc.Context, ctrl floc.Control) error {
		return errors.New("error " + msg)
	}
}

flow := run.Parallel(fail("asd"), fail("qwe"))
result, data, err := floc.Run(flow)

The err only contains one of the errors as far as I can tell. Seems like there is an ErrMultiple type, but I don't know how to use it.

Thank you for your help!

Kirhchoff avatar Oct 20 '23 08:10 Kirhchoff