Skip to content

Commit

Permalink
Merge branch 'dev' into feature/error-handle
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene028 committed Aug 22, 2024
2 parents 866ecc5 + 140dbf4 commit e200ba4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"nanoid": "^5.0.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-error-boundary": "^4.0.13",
"react-hook-form": "^7.50.1",
"react-router-dom": "^6.22.1",
"react-toastify": "^10.0.4",
Expand Down
14 changes: 13 additions & 1 deletion src/components/ApiErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,19 @@ export default function ApiErrorBoundary({
toast.error(message);
break;
}

if (errorResponse) {
// eslint-disable-next-line import/namespace
Sentry.captureException(errorResponse, {});
}
}

return <>{children}</>;
return (
<ErrorBoundary

Check failure on line 56 in src/components/ApiErrorBoundary.tsx

View workflow job for this annotation

GitHub Actions / build

Cannot find name 'ErrorBoundary'. Did you mean 'ApiErrorBoundary'?
{...rest}

Check failure on line 57 in src/components/ApiErrorBoundary.tsx

View workflow job for this annotation

GitHub Actions / build

Cannot find name 'rest'.
onError={(error) => handleError(error as AxiosError)}

Check failure on line 58 in src/components/ApiErrorBoundary.tsx

View workflow job for this annotation

GitHub Actions / build

Parameter 'error' implicitly has an 'any' type.
fallbackRender={() => <NotFoundPage />}>

Check failure on line 59 in src/components/ApiErrorBoundary.tsx

View workflow job for this annotation

GitHub Actions / build

Cannot find name 'NotFoundPage'.
{children}
</ErrorBoundary>

Check failure on line 61 in src/components/ApiErrorBoundary.tsx

View workflow job for this annotation

GitHub Actions / build

Cannot find name 'ErrorBoundary'. Did you mean 'ApiErrorBoundary'?
);
}

0 comments on commit e200ba4

Please sign in to comment.