Skip to content

Commit

Permalink
add data to error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyang0 committed May 10, 2024
1 parent 22bd2a1 commit 7892587
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions flow/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ func (e *Executor) Execute(ctx context.Context) error {
}
}()
if node.execOpts.failureHandler != nil {
if err1 := node.execOpts.failureHandler(err); err1 != nil {
if err1 := node.execOpts.failureHandler(e.Body, err); err1 != nil {
return errors.CombineErrors(err, err1)
}
}
if retried >= maxRetry {
if node.execOpts.finalFailureHandler != nil {
if err2 := node.execOpts.finalFailureHandler(err); err2 != nil {
if err2 := node.execOpts.finalFailureHandler(e.Body, err); err2 != nil {
return errors.CombineErrors(err, err2)
}
}
Expand Down
2 changes: 1 addition & 1 deletion flow/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type Forwarder func([]byte) []byte
// ForEach definition for the foreach function
type ForEach func([]byte) map[string][]byte

type FuncErrorHandler func(error) error
type FuncErrorHandler func([]byte, error) error

type ExecutionOptions struct {
aggregator Aggregator
Expand Down

0 comments on commit 7892587

Please sign in to comment.