Log OTA errors properly (#9101)
* Log OTA errors properly * filter out network errors
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
|||||||
useUpdates,
|
useUpdates,
|
||||||
} from 'expo-updates'
|
} from 'expo-updates'
|
||||||
|
|
||||||
|
import {isNetworkError} from '#/lib/strings/errors'
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {isIOS} from '#/platform/detection'
|
import {isIOS} from '#/platform/detection'
|
||||||
import {IS_TESTFLIGHT} from '#/env'
|
import {IS_TESTFLIGHT} from '#/env'
|
||||||
@@ -145,8 +146,10 @@ export function useOTAUpdates() {
|
|||||||
} else {
|
} else {
|
||||||
logger.debug('No update available.')
|
logger.debug('No update available.')
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (err) {
|
||||||
logger.error('OTA Update Error', {error: `${e}`})
|
if (!isNetworkError(err)) {
|
||||||
|
logger.error('OTA Update Error', {safeMessage: err})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, 10e3)
|
}, 10e3)
|
||||||
}, [])
|
}, [])
|
||||||
@@ -154,8 +157,10 @@ export function useOTAUpdates() {
|
|||||||
const onIsTestFlight = React.useCallback(async () => {
|
const onIsTestFlight = React.useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
await updateTestflight()
|
await updateTestflight()
|
||||||
} catch (e: any) {
|
} catch (err: any) {
|
||||||
logger.error('Internal OTA Update Error', {error: `${e}`})
|
if (!isNetworkError(err)) {
|
||||||
|
logger.error('Internal OTA Update Error', {safeMessage: err})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user