[Session] Include stack with the debug event (#4763)

zio/stable
dan 2024-07-10 00:51:12 +01:00 committed by GitHub
parent 9b9e09d002
commit fa64d9393b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -76,7 +76,12 @@ export function addSessionErrorLog(did: string, event: AtpSessionEvent) {
if (!Statsig.initializeCalled() || !Statsig.getStableID()) {
return
}
Statsig.logEvent('session:error', null, {did, event})
const stack = (new Error().stack ?? '').slice(0, MAX_SLICE_LENGTH)
Statsig.logEvent('session:error', null, {
did,
event,
stack,
})
} catch (e) {
console.error(e)
}