Try to capture connect failure

This commit is contained in:
xmflsct 2022-11-14 16:04:15 +01:00
parent 95f0c5859b
commit f11d3abe98
1 changed files with 7 additions and 0 deletions

View File

@ -3,6 +3,7 @@ import apiTooot from '@api/tooot'
import { displayMessage } from '@components/Message'
import navigationRef from '@helpers/navigationRef'
import { useAppDispatch } from '@root/store'
import * as Sentry from '@sentry/react-native'
import { InstanceLatest } from '@utils/migrations/instances/migration'
import { getExpoToken, retrieveExpoToken } from '@utils/slices/appSlice'
import { disableAllPushes } from '@utils/slices/instancesSlice'
@ -33,6 +34,12 @@ const pushUseConnect = ({ t, instances }: Params) => {
url: `push/connect/${expoToken}`,
sentry: true
}).catch(error => {
Sentry.setExtras({
API: 'tooot',
...(error?.response && { response: error.response }),
...(error?.request && { request: error.request })
})
Sentry.captureException(error)
Notifications.setBadgeCountAsync(0)
if (error?.status == 404) {
displayMessage({