Skip to content

Commit

Permalink
Merge pull request #11 from ecency/bugfix/bugsnag
Browse files Browse the repository at this point in the history
Turned off bugsnag
  • Loading branch information
feruzm authored Sep 11, 2024
2 parents 21e6f4f + 7d599c0 commit 3bc9d09
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 98 deletions.
179 changes: 88 additions & 91 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/sw.js

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions src/app/global-error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"use client"; // Error boundaries must be Client Components

export default function GlobalError({
error,
reset
}: {
error: Error & { digest?: string };
reset: () => void;
}) {
return (
// global-error must include html and body tags
<html>
<body>
<h2>Something went wrong!</h2>
<button onClick={() => reset()}>Try again</button>
</body>
</html>
);
}
9 changes: 3 additions & 6 deletions src/app/providers.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { PropsWithChildren } from "react";
import { PushNotificationsProvider } from "@/features/push-notifications";
import { ClientProviders } from "@/app/client-providers";
import { BugsnagErrorBoundary } from "@/features/bugsnag";

export default function Providers({ children }: PropsWithChildren) {
return (
<BugsnagErrorBoundary>
<ClientProviders>
<PushNotificationsProvider>{children}</PushNotificationsProvider>
</ClientProviders>
</BugsnagErrorBoundary>
<ClientProviders>
<PushNotificationsProvider>{children}</PushNotificationsProvider>
</ClientProviders>
);
}
2 changes: 2 additions & 0 deletions src/features/bugsnag.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import Bugsnag from "@bugsnag/js";
import BugsnagPluginReact from "@bugsnag/plugin-react";
import BugsnagPerformance from "@bugsnag/browser-performance";
Expand Down

0 comments on commit 3bc9d09

Please sign in to comment.