Little more error handling

This commit is contained in:
Eric Bailey
2026-02-11 10:28:51 -06:00
parent 496a54b469
commit 2586450f73
+18 -3
View File
@@ -144,6 +144,7 @@ function GermSelfButton({did}: {did: string}) {
async function undo() { async function undo() {
if (!previousRecord) return if (!previousRecord) return
try {
await agent.com.germnetwork.declaration.put( await agent.com.germnetwork.declaration.put(
{ {
repo: did, repo: did,
@@ -155,8 +156,20 @@ function GermSelfButton({did}: {did: string}) {
await queryClient.refetchQueries({queryKey: RQKEY(did)}) await queryClient.refetchQueries({queryKey: RQKEY(did)})
Toast.show(_(msg`Germ DM reconnected`)) Toast.show(_(msg`Germ DM reconnected`))
ax.metric('profile:associated:germ:self-reconnect', {}) ax.metric('profile:associated:germ:self-reconnect', {})
} catch (e: any) {
Toast.show(
_(msg`Failed to reconnect Germ DM. Error: ${e?.message}`),
{
type: 'error',
},
)
if (!isNetworkError(e)) {
ax.logger.error('Failed to reconnect Germ DM link', {
safeMessage: e,
})
}
}
} }
selfExplanationDialogControl.close(() => { selfExplanationDialogControl.close(() => {
@@ -178,13 +191,15 @@ function GermSelfButton({did}: {did: string}) {
}, },
onError: error => { onError: error => {
Toast.show( Toast.show(
_(msg`Failed to remove Germ DM link. Error: ${error?.message}`), _(msg`Failed to disconnect Germ DM. Error: ${error?.message}`),
{ {
type: 'error', type: 'error',
}, },
) )
if (!isNetworkError(error)) { if (!isNetworkError(error)) {
ax.logger.error('Failed to remove Germ DM link', {safeMessage: error}) ax.logger.error('Failed to disconnect Germ DM link', {
safeMessage: error,
})
} }
}, },
}) })