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

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