Ver código fonte

fix: catch capture errors

Tienson Qin 4 anos atrás
pai
commit
77eea65310

+ 5 - 1
src/main/frontend/modules/instrumentation/posthog.cljs

@@ -39,7 +39,11 @@
       (posthog/opt_in_capturing))))
 
 (defn capture [id data]
-  (posthog/capture (str id) (bean/->js data)))
+  (try
+    (posthog/capture (str id) (bean/->js data))
+    (catch js/Error _e
+      ;; opt out or network issues
+      nil)))
 
 (comment
   (posthog/debug))