mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-03 13:46:38 -04:00
marginally better error logging
This commit is contained in:
@ -19,7 +19,8 @@ const HitCounter = async ({ slug }: { slug: string }) => {
|
||||
// we have data!
|
||||
return <span title={`${commaNumber(hits)} ${hits === 1 ? "view" : "views"}`}>{commaNumber(hits)}</span>;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
console.error("[hit counter] fatal error:", error);
|
||||
|
||||
throw new Error();
|
||||
}
|
||||
};
|
||||
|
@ -117,7 +117,7 @@ export default async function Page({ params }: { params: Promise<{ slug: string
|
||||
</div>
|
||||
|
||||
{/* only count hits on production site */}
|
||||
{process.env.NEXT_PUBLIC_VERCEL_ENV === "production" && (
|
||||
{process.env.NEXT_PUBLIC_VERCEL_ENV !== "development" && process.env.NODE_ENV !== "development" ? (
|
||||
<ErrorBoundary fallback={null}>
|
||||
<div
|
||||
className={styles.metaItem}
|
||||
@ -133,7 +133,7 @@ export default async function Page({ params }: { params: Promise<{ slug: string
|
||||
</Suspense>
|
||||
</div>
|
||||
</ErrorBoundary>
|
||||
)}
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
<h1 className={styles.title}>
|
||||
|
Reference in New Issue
Block a user