fix(code-runtime): contain hostile boundary failures

This commit is contained in:
Tianyi Cui
2026-08-08 21:27:57 +08:00
parent f84f63ccd7
commit 71e0eeac40
2 changed files with 26 additions and 1 deletions
@@ -49,7 +49,11 @@ export type RuntimeBindingReply =
* @returns the caller-facing diagnostic text.
*/
export function runtimeErrorMessage(error: unknown): string {
return error instanceof Error ? error.message : String(error)
try {
return error instanceof Error ? error.message : String(error)
} catch {
return 'binding rejected with an unrenderable value'
}
}
/**