mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-03 11:26:37 -04:00
marginally better error logging
This commit is contained in:
@ -27,7 +27,7 @@ export async function sendMessage(
|
||||
|
||||
// backup to client-side validations just in case someone squeezes through without them
|
||||
if (!validatedFields.success) {
|
||||
console.error(validatedFields.error.flatten());
|
||||
console.error("[contact form] validation error:", validatedFields.error.flatten());
|
||||
|
||||
return {
|
||||
success: false,
|
||||
@ -51,7 +51,7 @@ export async function sendMessage(
|
||||
});
|
||||
|
||||
if (!turnstileResponse.ok) {
|
||||
throw new Error(`Turnstile validation failed: ${turnstileResponse.status}`);
|
||||
throw new Error(`[contact form] turnstile validation failed: ${turnstileResponse.status}`);
|
||||
}
|
||||
|
||||
const turnstileData = await turnstileResponse?.json();
|
||||
@ -76,7 +76,7 @@ export async function sendMessage(
|
||||
|
||||
return { success: true, message: "Thanks! You should hear from me soon.", payload: formData };
|
||||
} catch (error) {
|
||||
console.error("Contact form error:", error);
|
||||
console.error("[contact form] fatal error:", error);
|
||||
|
||||
return {
|
||||
success: false,
|
||||
|
@ -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