remove duplicated list of errors

This commit is contained in:
Samuel Newman
2026-08-19 16:50:48 +03:00
parent ad27f071b6
commit c6380851dc
2 changed files with 3 additions and 9 deletions
+2 -8
View File
@@ -1,6 +1,8 @@
import {useCallback} from 'react'
import {useLingui} from '@lingui/react/macro'
import {NETWORK_ERRORS} from '#/lib/strings/errors'
type CleanedError = {
raw: string | undefined
clean: string | undefined
@@ -82,14 +84,6 @@ export function useCleanError() {
)
}
const NETWORK_ERRORS = [
'Abort',
'Network request failed',
'Failed to fetch',
'Load failed',
'Upstream service unreachable',
]
export function isNetworkError(e: unknown) {
const str = String(e)
for (const err of NETWORK_ERRORS) {
+1 -1
View File
@@ -79,7 +79,7 @@ export function cleanError(e: unknown): string {
return toDisplayString(e, str)
}
const NETWORK_ERRORS = [
export const NETWORK_ERRORS = [
'Abort',
'Network request failed',
'Network request timed out',