diff --git a/components/common/Navbar/Navbar.tsx b/components/common/Navbar/Navbar.tsx index 2ce5f33b8..196ee5c6a 100644 --- a/components/common/Navbar/Navbar.tsx +++ b/components/common/Navbar/Navbar.tsx @@ -4,6 +4,8 @@ import s from './Navbar.module.css' import NavbarRoot from './NavbarRoot' import { Logo, Container } from '@components/ui' import { Searchbar, UserNav } from '@components/common' +import { getSentryRelease } from '@sentry/node' +import * as Sentry from '@sentry/nextjs' interface Link { href: string @@ -16,6 +18,45 @@ interface NavbarProps { const Navbar: FC = ({ links }) => ( + + +
diff --git a/pages/api/error.ts b/pages/api/error.ts new file mode 100644 index 000000000..17a7f1f30 --- /dev/null +++ b/pages/api/error.ts @@ -0,0 +1,18 @@ +import type { NextApiRequest, NextApiResponse } from "next" +import { withSentry } from "@sentry/nextjs"; +import * as Sentry from '@sentry/nextjs' + +const handler = async (req: NextApiRequest, res: NextApiResponse) => { + try { + console.log('try api') + throw new Error("API throw error test") + res.status(200).json({ name: "John Doe" }); + } + catch (ex) { + console.log('caught exception') + Sentry.captureException(ex) + res.status(500).json({ error: "cannot complete request"}); + } +}; + +export default withSentry(handler); \ No newline at end of file