fix(ui): replace raw AxiosError dumps with QueryErrorState across routes

This commit is contained in:
Александр Зимин
2026-05-14 20:42:45 +00:00
parent 1a5049aac4
commit 9e6ddd1bce
5 changed files with 34 additions and 39 deletions
@@ -1,6 +1,6 @@
import { useEffect, useMemo, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { Alert, Badge, Button, LoadingBlock, Modal, TextInput } from '@/ui'
import { Alert, Badge, Button, LoadingBlock, Modal, QueryErrorState, TextInput } from '@/ui'
import { WarningIcon, XCircleIcon } from '@phosphor-icons/react'
import { useCascadePreview } from '@/api/queries'
import { useCascadeCloseRecord } from '@/api/mutations'
@@ -116,9 +116,7 @@ export const CascadeConfirmDialog = ({
{preview.isLoading && <LoadingBlock size="md" label={t('loading')} />}
{preview.error && (
<Alert variant="error" title={t('error.failed')}>
{String(preview.error)}
</Alert>
<QueryErrorState error={preview.error} onRetry={() => preview.refetch()} />
)}
{plan && (
@@ -261,9 +259,9 @@ export const CascadeConfirmDialog = ({
)}
{cascadeMut.error && (
<Alert variant="error" title={t('error.failed')}>
{String(cascadeMut.error)}
</Alert>
/* Mutation error — no retry button (user triggers via Confirm
again). QueryErrorState classifies 4xx/5xx code/message. */
<QueryErrorState error={cascadeMut.error} />
)}
</>
)}