mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-22 19:55:11 +00:00
tweak: unserializable error handling
This commit is contained in:
parent
61c334f1fb
commit
04cea9cf11
1 changed files with 4 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue