summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAiden Cline <[email protected]>2026-01-07 00:29:13 -0600
committerAiden Cline <[email protected]>2026-01-07 00:29:41 -0600
commit04cea9cf1198c4ea083625304c63bbcfbe9223f5 (patch)
tree2501195f38fe0c7251e2243b574279ca4dfbb8b1
parent61c334f1fb5cc4f49684ce2424cb8cb95521f967 (diff)
downloadopencode-04cea9cf1198c4ea083625304c63bbcfbe9223f5.tar.gz
opencode-04cea9cf1198c4ea083625304c63bbcfbe9223f5.zip
tweak: unserializable error handling
-rw-r--r--packages/opencode/src/cli/error.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/opencode/src/cli/error.ts b/packages/opencode/src/cli/error.ts
index 54ced0d7a..569b186d5 100644
--- a/packages/opencode/src/cli/error.ts
+++ b/packages/opencode/src/cli/error.ts
@@ -47,9 +47,10 @@ export function FormatUnknownError(input: unknown): string {
if (typeof input === "object" && input !== null) {
try {
- const json = JSON.stringify(input, null, 2)
- if (json && json !== "{}") return json
- } catch {}
+ return JSON.stringify(input, null, 2)
+ } catch {
+ return "Unexpected error (unserializable)"
+ }
}
return String(input)