'use client' import { Button } from '@langgenius/dify-ui/button' import { useQueryErrorResetBoundary } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' import { FullScreenLoading } from '@/app/components/full-screen-loading' import { isUnauthorizedError } from '@/service/http-error' type Props = Readonly<{ error: Error & { digest?: string } retry: () => void }> export default function AppError({ error, retry }: Props) { const { t } = useTranslation(['common']) const { reset: resetQueries } = useQueryErrorResetBoundary() console.error(error) if (isUnauthorizedError(error)) return return (
{t(($) => $['errorBoundary.message'])}
) }