diff options
author | Eric Bailey <git@esb.lol> | 2025-07-18 10:19:56 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-18 10:19:56 -0500 |
commit | 6a15679fb118dd07fe869311e6d3c4721c221b58 (patch) | |
tree | 2418b1d57dae73e83bc6769780c2d74e108346d4 /src/components/ageAssurance | |
parent | 4dd9459cba81f0212d910c02bde7e6cd013c042b (diff) | |
download | voidsky-6a15679fb118dd07fe869311e6d3c4721c221b58.tar.zst |
Handle missed error branch (#8663)
Diffstat (limited to 'src/components/ageAssurance')
-rw-r--r-- | src/components/ageAssurance/AgeAssuranceInitDialog.tsx | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/components/ageAssurance/AgeAssuranceInitDialog.tsx b/src/components/ageAssurance/AgeAssuranceInitDialog.tsx index 18c7641e3..08fd5f84f 100644 --- a/src/components/ageAssurance/AgeAssuranceInitDialog.tsx +++ b/src/components/ageAssurance/AgeAssuranceInitDialog.tsx @@ -134,16 +134,18 @@ function Inner() { setSuccess(true) } catch (e) { + let error: React.ReactNode = _( + msg`Something went wrong, please try again`, + ) + if (e instanceof XRPCError) { if (e.error === 'InvalidEmail') { - setError( - _( - msg`Please enter a valid, non-temporary email address. You may need to access this email in the future.`, - ), + error = _( + msg`Please enter a valid, non-temporary email address. You may need to access this email in the future.`, ) logger.metric('ageAssurance:initDialogError', {code: 'InvalidEmail'}) } else if (e.error === 'DidTooLong') { - setError( + error = ( <> <Trans> We're having issues initializing the age assurance process for @@ -155,15 +157,19 @@ function Inner() { </InlineLinkText>{' '} for assistance. </Trans> - </>, + </> ) logger.metric('ageAssurance:initDialogError', {code: 'DidTooLong'}) + } else { + logger.metric('ageAssurance:initDialogError', {code: 'other'}) } } else { const {clean, raw} = cleanError(e) - setError(clean || raw || _(msg`Something went wrong, please try again`)) + error = clean || raw || error logger.metric('ageAssurance:initDialogError', {code: 'other'}) } + + setError(error) } } |