fix(tui): fail fast on invalid session startup (#23837)

This commit is contained in:
Shoubhit Dash
2026-04-22 16:35:13 +05:30
committed by Aiden Cline
parent d884ab73d5
commit 6196b81e0a
5 changed files with 97 additions and 21 deletions

View File

@@ -26,6 +26,15 @@ export function errorMessage(error: unknown): string {
return error.message
}
if (
isRecord(error) &&
isRecord(error.data) &&
typeof error.data.message === "string" &&
error.data.message
) {
return error.data.message
}
const text = String(error)
if (text && text !== "[object Object]") return text