about summary refs log tree commit diff
path: root/src/screens/Signup/StepCaptcha/index.tsx
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2024-05-01 01:08:59 -0700
committerGitHub <noreply@github.com>2024-05-01 01:08:59 -0700
commitb8d8bec388744c95aa84c955849d2bced45daf11 (patch)
tree987435632fae8bbfea56c935e6d55021356b636a /src/screens/Signup/StepCaptcha/index.tsx
parent81ae7e425dc52846c5d4c282a0422a3875d84e2f (diff)
downloadvoidsky-b8d8bec388744c95aa84c955849d2bced45daf11.tar.zst
sentry errors for captcha web views and registration attempts (#3761)
* sentry errors for captcha web views

* include handles with errors

* log all registration request failures

* rm

* use a better trigger for web captcha errors

* add another trigger for recording a possible signup error

* unknown error type

* don't needlessly log on href errors

* honestly i probably cant always do a captcha in 20 seconds

* rm log

* timeout on back

* remove unnecessary colons
Diffstat (limited to 'src/screens/Signup/StepCaptcha/index.tsx')
-rw-r--r--src/screens/Signup/StepCaptcha/index.tsx20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/screens/Signup/StepCaptcha/index.tsx b/src/screens/Signup/StepCaptcha/index.tsx
index 2429b0c5e..d0fc4e934 100644
--- a/src/screens/Signup/StepCaptcha/index.tsx
+++ b/src/screens/Signup/StepCaptcha/index.tsx
@@ -5,6 +5,7 @@ import {useLingui} from '@lingui/react'
 import {nanoid} from 'nanoid/non-secure'
 
 import {createFullHandle} from '#/lib/strings/handles'
+import {logger} from '#/logger'
 import {ScreenTransition} from '#/screens/Login/ScreenTransition'
 import {useSignupContext, useSubmitSignup} from '#/screens/Signup/state'
 import {CaptchaWebView} from '#/screens/Signup/StepCaptcha/CaptchaWebView'
@@ -43,12 +44,19 @@ export function StepCaptcha() {
     [submit],
   )
 
-  const onError = React.useCallback(() => {
-    dispatch({
-      type: 'setError',
-      value: _(msg`Error receiving captcha response.`),
-    })
-  }, [_, dispatch])
+  const onError = React.useCallback(
+    (error?: unknown) => {
+      dispatch({
+        type: 'setError',
+        value: _(msg`Error receiving captcha response.`),
+      })
+      logger.error('Signup Flow Error', {
+        registrationHandle: state.handle,
+        error,
+      })
+    },
+    [_, dispatch, state.handle],
+  )
 
   return (
     <ScreenTransition>