Log error statuses from failed resume session calls (#4174)

* Add log to track how resume fails

* Use safe field name

* Better log

* Properly catch
zio/stable
Eric Bailey 2024-05-23 13:27:53 -05:00 committed by GitHub
parent e5fc0baa6a
commit 6d647551cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 1 deletions

View File

@ -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
},
)
}
}