From da3ad5ba2fecd02ac3e879d6f9a3fd9118a0914d Mon Sep 17 00:00:00 2001 From: Erwan Leboucher Date: Fri, 28 Aug 2026 20:40:26 +0200 Subject: [PATCH] fix(client): show load failures that are not Error objects --- src/app/pages/client/ClientRoot.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/pages/client/ClientRoot.tsx b/src/app/pages/client/ClientRoot.tsx index 621d72809..42dea872f 100644 --- a/src/app/pages/client/ClientRoot.tsx +++ b/src/app/pages/client/ClientRoot.tsx @@ -60,6 +60,9 @@ const log = createLogger('ClientRoot'); const SESSION_SWITCH_KEY = 'sable-session-switch'; +const errorMessage = (error: unknown): string => + error instanceof Error ? error.message : String(error); + const isClientReady = (syncState: string | null): boolean => syncState === 'PREPARED' || syncState === 'SYNCING' || syncState === 'CATCHUP'; @@ -509,10 +512,10 @@ export function ClientRoot({ children }: ClientRootProps) { ) : ( - {`Failed to load. ${loadState.error.message}`} + {`Failed to load. ${errorMessage(loadState.error)}`} ))} {startState.status === AsyncStatus.Error && ( - {`Failed to start. ${startState.error.message}`} + {`Failed to start. ${errorMessage(startState.error)}`} )} {!legacyCryptoUpgradeRequired && (