Skip to content

Commit

Permalink
Merge pull request #73 from quantum-brackets/sentry-setup
Browse files Browse the repository at this point in the history
added catch exception to global error
  • Loading branch information
henzyd authored Nov 9, 2024
2 parents 233a8c9 + 7c62f33 commit ac69673
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/global-error.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"use client";

import { useEffect } from "react";
import Image from "next/image";
import { captureException } from "@sentry/nextjs";
import { ThemeProvider } from "@mui/material/styles";
import theme from "./theme";
import Button from "~/components/button";
Expand All @@ -15,7 +17,9 @@ export default function GlobalError({
error: Error & { digest?: string };
reset: () => void;
}) {
console.error(error);
useEffect(() => {
captureException(error);
}, [error]);

return (
<html>
Expand Down

0 comments on commit ac69673

Please sign in to comment.