1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-03 12:46:38 -04:00

add sentry to investigate 500 errors

This commit is contained in:
2025-03-04 15:46:50 -05:00
parent a73323ae8b
commit 8f946d50d8
11 changed files with 2013 additions and 22 deletions

23
app/global-error.tsx Normal file
View File

@ -0,0 +1,23 @@
"use client";
import * as Sentry from "@sentry/nextjs";
import NextError from "next/error";
import { useEffect } from "react";
export default function GlobalError({ error }: { error: Error & { digest?: string } }) {
useEffect(() => {
Sentry.captureException(error);
}, [error]);
return (
<html>
<body>
{/* `NextError` is the default Next.js error page component. Its type
definition requires a `statusCode` prop. However, since the App Router
does not expose status codes for errors, we simply pass 0 to render a
generic error message. */}
<NextError statusCode={0} />
</body>
</html>
);
}

View File

@ -1,4 +1,3 @@
import { useId } from "react";
import { GoLock } from "react-icons/go";
import { rgba } from "polished";
import Link from "../components/Link";
@ -16,15 +15,15 @@ const ColorfulLink = ({
lightColor: string;
darkColor: string;
}) => {
const uniqueId = `Link_themed__${useId().replace(/\W/g, "")}`;
const uniqueId = `Link_themed__${lightColor.replace("#", "")}_${darkColor.replace("#", "")}`;
return (
<>
<Link id={uniqueId} {...rest}>
<Link className={uniqueId} {...rest}>
{children}
</Link>
<style>{`.${styles.page} #${uniqueId}{color:${lightColor};--colors-linkUnderline:${rgba(lightColor, 0.4)}}[data-theme="dark"] .${styles.page} #${uniqueId}{color:${darkColor};--colors-linkUnderline:${rgba(darkColor, 0.4)}}`}</style>
<style>{`.${styles.page} .${uniqueId}{--colors-link:${lightColor};--colors-linkUnderline:${rgba(lightColor, 0.4)}}[data-theme="dark"] .${styles.page} .${uniqueId}{--colors-link:${darkColor};--colors-linkUnderline:${rgba(darkColor, 0.4)}}`}</style>
</>
);
};
@ -278,8 +277,8 @@ export default function Page() {
href="https://bsky.app/profile/jarv.is"
rel="me"
title="Jake Jarvis on Bluesky"
lightColor="#0085FF"
darkColor="#208BFE"
lightColor="#0085ff"
darkColor="#208bfe"
>
Bluesky
</ColorfulLink>