my fork of the bluesky client
0
fork

Configure Feed

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

Better error message (+ translations!) (#6349)

* clean network errors for new common eerors

* translate errors

authored by samuel.fm and committed by

GitHub a9cacbf2 3bd14371

+10 -4
+10 -4
src/lib/strings/errors.ts
··· 1 + import {t} from '@lingui/macro' 2 + 1 3 export function cleanError(str: any): string { 2 4 if (!str) { 3 5 return '' ··· 6 8 str = str.toString() 7 9 } 8 10 if (isNetworkError(str)) { 9 - return 'Unable to connect. Please check your internet connection and try again.' 11 + return t`Unable to connect. Please check your internet connection and try again.` 10 12 } 11 - if (str.includes('Upstream Failure')) { 12 - return 'The server appears to be experiencing issues. Please try again in a few moments.' 13 + if ( 14 + str.includes('Upstream Failure') || 15 + str.includes('NotEnoughResources') || 16 + str.includes('pipethrough network error') 17 + ) { 18 + return t`The server appears to be experiencing issues. Please try again in a few moments.` 13 19 } 14 20 if (str.includes('Bad token scope')) { 15 - return 'This feature is not available while using an App Password. Please sign in with your main password.' 21 + return t`This feature is not available while using an App Password. Please sign in with your main password.` 16 22 } 17 23 if (str.startsWith('Error: ')) { 18 24 return str.slice('Error: '.length)