Files
windmill/backend/tests
hugocasaandClaude Opus 5.5 9cd04d0a88 fix: keep the real error when a Bun script throws a cyclic error (#12232)
* fix: keep the real error when a Bun script throws a cyclic error

The Bun wrapper copies a thrown error's own properties into `extra` and
JSON-encodes the result. When one of them is cyclic (AWS SDK v3 errors'
`$response`), the encoding threw and the job error became
"cannot serialize cyclic structures". Fall back to an encoding that
replaces back-references with "[Circular]", keeping the plain encoding
first so non-cyclic errors are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: replace only the unencodable fields of a Bun error's extra

Encode each field of `extra` on its own when the whole error fails, and
replace the ones that throw with "[unserializable]". Simpler than walking
cycles, and drops noise like AWS's `$response` while keeping `Code` and
`$metadata`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 23:29:19 +01:00
..