Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Handle missed error branch (#8663)

authored by

Eric Bailey and committed by
GitHub
6a15679f 4dd9459c

+13 -7
+13 -7
src/components/ageAssurance/AgeAssuranceInitDialog.tsx
··· 134 134 135 135 setSuccess(true) 136 136 } catch (e) { 137 + let error: React.ReactNode = _( 138 + msg`Something went wrong, please try again`, 139 + ) 140 + 137 141 if (e instanceof XRPCError) { 138 142 if (e.error === 'InvalidEmail') { 139 - setError( 140 - _( 141 - msg`Please enter a valid, non-temporary email address. You may need to access this email in the future.`, 142 - ), 143 + error = _( 144 + msg`Please enter a valid, non-temporary email address. You may need to access this email in the future.`, 143 145 ) 144 146 logger.metric('ageAssurance:initDialogError', {code: 'InvalidEmail'}) 145 147 } else if (e.error === 'DidTooLong') { 146 - setError( 148 + error = ( 147 149 <> 148 150 <Trans> 149 151 We're having issues initializing the age assurance process for ··· 155 157 </InlineLinkText>{' '} 156 158 for assistance. 157 159 </Trans> 158 - </>, 160 + </> 159 161 ) 160 162 logger.metric('ageAssurance:initDialogError', {code: 'DidTooLong'}) 163 + } else { 164 + logger.metric('ageAssurance:initDialogError', {code: 'other'}) 161 165 } 162 166 } else { 163 167 const {clean, raw} = cleanError(e) 164 - setError(clean || raw || _(msg`Something went wrong, please try again`)) 168 + error = clean || raw || error 165 169 logger.metric('ageAssurance:initDialogError', {code: 'other'}) 166 170 } 171 + 172 + setError(error) 167 173 } 168 174 } 169 175