From df7f9856bbbdb05a38d7a09ba0dec875be3d3a34 Mon Sep 17 00:00:00 2001
From: dan <dan.abramov@gmail.com>
Date: Thu, 21 Mar 2024 21:39:19 +0000
Subject: Use logger.error instead of rethrow (#3323)

---
 src/lib/statsig/statsig.tsx | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

(limited to 'src/lib/statsig/statsig.tsx')

diff --git a/src/lib/statsig/statsig.tsx b/src/lib/statsig/statsig.tsx
index a9d69fda7..68c63de61 100644
--- a/src/lib/statsig/statsig.tsx
+++ b/src/lib/statsig/statsig.tsx
@@ -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'
 
@@ -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})
   }
 }
 
-- 
cgit 1.4.1

