From 6d647551cd2fcf9d66c3795df8f6764bf60f6df1 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 23 May 2024 13:27:53 -0500 Subject: [PATCH] Log error statuses from failed resume session calls (#4174) * Add log to track how resume fails * Use safe field name * Better log * Properly catch --- src/state/session/agent.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/state/session/agent.ts b/src/state/session/agent.ts index 27e1af4c..45013deb 100644 --- a/src/state/session/agent.ts +++ b/src/state/session/agent.ts @@ -53,7 +53,17 @@ export async function createAgentAndResume( agent.session = prevSession if (!storedAccount.deactivated) { // Intentionally not awaited to unblock the UI: - networkRetry(3, () => agent.resumeSession(prevSession)) + networkRetry(3, () => agent.resumeSession(prevSession)).catch( + (e: any) => { + logger.error(`networkRetry failed to resume session`, { + status: e?.status || 'unknown', + // this field name is ignored by Sentry scrubbers + safeMessage: e?.message || 'unknown', + }) + + throw e + }, + ) } }