Log OTA errors properly (#9101)

* Log OTA errors properly

* filter out network errors
This commit is contained in:
Samuel Newman
2025-09-29 22:14:39 +03:00
committed by GitHub
parent 2b32fff1d0
commit 02a25d2aa2
+9 -4
View File
@@ -10,6 +10,7 @@ import {
useUpdates,
} from 'expo-updates'
import {isNetworkError} from '#/lib/strings/errors'
import {logger} from '#/logger'
import {isIOS} from '#/platform/detection'
import {IS_TESTFLIGHT} from '#/env'
@@ -145,8 +146,10 @@ export function useOTAUpdates() {
} else {
logger.debug('No update available.')
}
} catch (e) {
logger.error('OTA Update Error', {error: `${e}`})
} catch (err) {
if (!isNetworkError(err)) {
logger.error('OTA Update Error', {safeMessage: err})
}
}
}, 10e3)
}, [])
@@ -154,8 +157,10 @@ export function useOTAUpdates() {
const onIsTestFlight = React.useCallback(async () => {
try {
await updateTestflight()
} catch (e: any) {
logger.error('Internal OTA Update Error', {error: `${e}`})
} catch (err: any) {
if (!isNetworkError(err)) {
logger.error('Internal OTA Update Error', {safeMessage: err})
}
}
}, [])