InternalRun implements the retry logic at the item level within Exec.
(ctx *PfContext)
| 524 | |
| 525 | // InternalRun implements the retry logic at the item level within Exec. |
| 526 | func (bn *BatchNode) InternalRun(ctx *PfContext) (string, error) { |
| 527 | prepRes, err := bn.Prep(ctx) // prepRes should be []any |
| 528 | if err != nil { |
| 529 | return "", newPocketFlowError(fmt.Sprintf("Prep phase failed in %T", bn), err) |
| 530 | } |
| 531 | |
| 532 | // Exec handles its own item-level retry/fallback |
| 533 | execRes, err := bn.Exec(ctx, prepRes) // execRes should be []any |
| 534 | if err != nil { |
| 535 | // Error from Exec already includes context about retries/fallbacks |
| 536 | return "", err // Don't wrap again |
| 537 | } |
| 538 | |
| 539 | // Post phase |
| 540 | action, err := bn.Post(ctx, prepRes, execRes) // Post expects []any, []any |
| 541 | if err != nil { |
| 542 | return "", newPocketFlowError(fmt.Sprintf("Post phase failed in %T", bn), err) |
| 543 | } |
| 544 | |
| 545 | return action, nil |
| 546 | } |
| 547 | |
| 548 | // --- Flow --- |
| 549 |
no test coverage detected