Commit 12046aa
Preserve underlying exception across executor step-failure wrap
Marin's StepRunner used to wrap every pipeline failure into a generic
`RuntimeError("N step(s) failed")` at the end of its orchestration
loop. That wrap threw away the concrete exception type and pushed the
real traceback two levels deep — in #5026 the
outer log said only `RuntimeError: 1 step(s) failed`, burying the
actual `LeaseLostError` that triage needed to see.
When exactly one step fails, re-raise the per-step
`RuntimeError("Step failed: <name>")` directly; its `__cause__` is
already the original exception, so the real type and traceback now
surface at the top of the log. With multiple independent failures we
keep the summary wrap (callers need the count) but still chain via
`from failures[0]` as before.
Tests updated: the executor and step-runner tests previously asserted
on the old `"1 step(s) failed"` message — they now match on the
per-step message directly and keep validating that the original
exception is preserved via `__cause__`. Added a new test for the
multi-failure summary path.
Refs #5026
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 5624419 commit 12046aa
3 files changed
Lines changed: 53 additions & 8 deletions
File tree
- lib/marin/src/marin/execution
- tests/execution
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
235 | 241 | | |
236 | 242 | | |
237 | 243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
238 | 241 | | |
239 | 242 | | |
240 | 243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
401 | | - | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
402 | 409 | | |
403 | 410 | | |
404 | 411 | | |
| |||
410 | 417 | | |
411 | 418 | | |
412 | 419 | | |
413 | | - | |
| 420 | + | |
414 | 421 | | |
415 | 422 | | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
421 | 457 | | |
422 | 458 | | |
423 | 459 | | |
| |||
0 commit comments