#4967·baml

[错误] `catch_all` 没有捕获调用函数内部引发的 `assert.*` 错误

作者: BenSpex创建于 2026年9月22日更新于 2026年9月22日

`catch_all` is expected to route any failure from the called function into the handler, and let the wrapping function return normally. When the called function fails via `assert.equal`/`assert.not_null` (rather than an explicit `throws` error), the failure is **not** routed to `catch_all` — it propagates straight out as a raw runtime assertion failure, and (inside a `test { }` block) is reported as if it were the outer test's own failed assertion, with no mention that `catch_all` was even present in the call chain. This makes `catch_all` unreliable as a general "did this call succeed" wrapper: it silently does not cover one whole class of failure that a called function can produce.

内容来源: BoundaryML/baml