Add Sentry error tracking to both apps
Planner (client + custom server) and Journal (client + entry.server): - Client: @sentry/react with browser tracing + replay on error - Server: @sentry/node for unhandled exceptions - ErrorBoundary captures React errors via Sentry.captureException - Disabled in dev, 10% trace sample rate in production Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
1819a17036
commit
ef07915f38
9 changed files with 982 additions and 278 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { Links, Meta, Outlet, Scripts, ScrollRestoration, isRouteErrorResponse } from "react-router";
|
||||
import type { LinksFunction } from "react-router";
|
||||
import type { Route } from "./+types/root";
|
||||
import * as Sentry from "@sentry/react";
|
||||
import stylesheet from "@trails-cool/ui/styles.css?url";
|
||||
|
||||
export const links: LinksFunction = () => [{ rel: "stylesheet", href: stylesheet }];
|
||||
|
|
@ -28,6 +29,8 @@ export default function App() {
|
|||
}
|
||||
|
||||
export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
|
||||
Sentry.captureException(error);
|
||||
|
||||
if (isRouteErrorResponse(error)) {
|
||||
return (
|
||||
<div className="flex h-full items-center justify-center">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue