Skip to content

Commit

Permalink
Use logger.error instead of rethrow (#3323)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored Mar 21, 2024
1 parent 4d50aac commit df7f985
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/lib/statsig/statsig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
useGate as useStatsigGate,
} from 'statsig-react-native-expo'

import {logger} from '#/logger'
import {useSession} from '../../state/session'
import {LogEvents} from './events'

Expand Down Expand Up @@ -56,10 +57,7 @@ export function logEvent<E extends keyof LogEvents>(
}
} catch (e) {
// A log should never interrupt the calling code, whatever happens.
// Rethrow on a clean stack.
setTimeout(() => {
throw e
})
logger.error('Failed to log an event', {message: e})
}
}

Expand Down

0 comments on commit df7f985

Please sign in to comment.