Bluesky app fork with some witchin' additions 💫

Log OTA errors properly (#9101)

* Log OTA errors properly

* filter out network errors

authored by samuel.fm and committed by

GitHub 02a25d2a 2b32fff1

+9 -4
+9 -4
src/lib/hooks/useOTAUpdates.ts
··· 10 useUpdates, 11 } from 'expo-updates' 12 13 import {logger} from '#/logger' 14 import {isIOS} from '#/platform/detection' 15 import {IS_TESTFLIGHT} from '#/env' ··· 145 } else { 146 logger.debug('No update available.') 147 } 148 - } catch (e) { 149 - logger.error('OTA Update Error', {error: `${e}`}) 150 } 151 }, 10e3) 152 }, []) ··· 154 const onIsTestFlight = React.useCallback(async () => { 155 try { 156 await updateTestflight() 157 - } catch (e: any) { 158 - logger.error('Internal OTA Update Error', {error: `${e}`}) 159 } 160 }, []) 161
··· 10 useUpdates, 11 } from 'expo-updates' 12 13 + import {isNetworkError} from '#/lib/strings/errors' 14 import {logger} from '#/logger' 15 import {isIOS} from '#/platform/detection' 16 import {IS_TESTFLIGHT} from '#/env' ··· 146 } else { 147 logger.debug('No update available.') 148 } 149 + } catch (err) { 150 + if (!isNetworkError(err)) { 151 + logger.error('OTA Update Error', {safeMessage: err}) 152 + } 153 } 154 }, 10e3) 155 }, []) ··· 157 const onIsTestFlight = React.useCallback(async () => { 158 try { 159 await updateTestflight() 160 + } catch (err: any) { 161 + if (!isNetworkError(err)) { 162 + logger.error('Internal OTA Update Error', {safeMessage: err}) 163 + } 164 } 165 }, []) 166