Commit bced653
committed
refactor(k8s): consolidate the 4 actions#341 throw sites via formatError()
actions#341 (merged 2026-06-03) replaced `JSON.stringify(error)` with
`error instanceof Error ? error.message : String(error)` at four throw
sites in k8s/index.ts. Now that `formatError()` ships in k8s/utils.ts
(introduced in the same PR as this commit), use it instead — a strict
superset that additionally:
- extracts `response.body.message` (and `reason`) from
@kubernetes/client-node API errors at `waitForPodPhases` and
`waitForJobToComplete`, which currently surface a generic
"HTTP request failed" instead of the actual K8s server message;
- never throws on circular references (the original actions#329 bug).
Also drops the `.stack ?? .message` branch in formatError() and returns
just `.message` for Error instances. This keeps the format predictable
(no stack trace dumped into user-visible CI errors) and lets actions#341's
`error-serialization-test.ts` continue to pass unchanged.1 parent c8d19d5 commit bced653
2 files changed
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
517 | 518 | | |
518 | 519 | | |
519 | 520 | | |
520 | | - | |
| 521 | + | |
521 | 522 | | |
522 | 523 | | |
523 | 524 | | |
| |||
614 | 615 | | |
615 | 616 | | |
616 | 617 | | |
617 | | - | |
| 618 | + | |
618 | 619 | | |
619 | 620 | | |
620 | 621 | | |
| |||
661 | 662 | | |
662 | 663 | | |
663 | 664 | | |
664 | | - | |
| 665 | + | |
665 | 666 | | |
666 | 667 | | |
667 | 668 | | |
| |||
784 | 785 | | |
785 | 786 | | |
786 | 787 | | |
787 | | - | |
| 788 | + | |
788 | 789 | | |
789 | 790 | | |
790 | 791 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
| 334 | + | |
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
| |||
0 commit comments