chore: redirect to /500 if pathname does not exist + better error handling (#18615)

* fix lint error

* fix booking page and better error handling
This commit is contained in:
Benny Joo
2025-01-13 00:04:36 +00:00
committed by GitHub
parent e07b1eda32
commit b3ed6e39e3
3 changed files with 9 additions and 6 deletions
+5
View File
@@ -2,6 +2,7 @@ import { _generateMetadata, getTranslate } from "app/_utils";
import { WithLayout } from "app/layoutHOC";
import { headers } from "next/headers";
import Link from "next/link";
import { redirect } from "next/navigation";
import {
getOrgDomainConfigFromHostname,
@@ -52,6 +53,10 @@ async function NotFound() {
const host = headersList.get("x-forwarded-host") ?? "";
const pathname = headersList.get("x-pathname") ?? "";
if (!pathname) {
redirect("/500");
}
const { username, pageType, url } = getPageInfo(pathname, host);
const isBookingSuccessPage = pathname?.startsWith("/booking");
const isSubpage = pathname?.includes("/", 2) || isBookingSuccessPage;
+1 -1
View File
@@ -61,7 +61,7 @@ export const ErrorPage: React.FC<Props> = (props) => {
<h1 className="font-cal text-emphasis text-6xl">{statusCode}</h1>
<h2 className="text-emphasis mt-6 max-w-2xl text-2xl font-medium">It's not you, it's us.</h2>
<p className="text-default mb-6 mt-4 max-w-2xl text-sm">
Something went wrong on our end. Get in touch with our support team, and we’ll get it fixed right
Something went wrong on our end. Get in touch with our support team, and we'll get it fixed right
away for you.
</p>
+3 -5
View File
@@ -177,17 +177,15 @@ export const config = {
"/event-types/:path*",
"/workflows/:path*",
"/getting-started/:path*",
"/auth/login",
"/future/auth/login",
"/workflows/:path*",
"/getting-started/:path*",
"/event-types/:path*",
"/apps/:path*",
"/routing/:path*",
"/bookings/:status/",
"/bookings/:path*",
"/video/:path*",
"/teams",
"/signup",
"/teams/:path*",
"/signup/:path*",
"/settings/:path*",
"/reschedule/:path*",
"/availability/:path*",