"use client"; import { useLayoutEffect } from "react"; import "@calcom/embed-core/src/embed-iframe"; import { HttpError } from "@calcom/lib/http-error"; import { Button } from "@calcom/ui/components/button"; type Props = { statusCode?: number | null; error?: Error | HttpError | null; message?: string; /** Display debugging information */ displayDebug?: boolean; children?: never; reset?: () => void; }; const defaultProps = { displayDebug: false, }; const ErrorDebugPanel: React.FC<{ error: Props["error"]; children?: never }> = (props) => { const { error: e } = props; const debugMap = [ ["error.message", e?.message], ["error.name", e?.name], ["error.class", e instanceof Error ? e.constructor.name : undefined], ["http.url", e instanceof HttpError ? e.url : undefined], ["http.status", e instanceof HttpError ? e.statusCode : undefined], ["http.cause", e instanceof HttpError ? e.cause?.message : undefined], ["error.stack", e instanceof Error ? e.stack : undefined], ]; return (
{debugMap.map(([key, value]) => { if (value !== undefined) { return (
{key}
{value}
); } })}
); }; export const ErrorPage: React.FC = (props) => { const { message, statusCode, error, displayDebug } = { ...defaultProps, ...props }; const handleReset = () => { window.location.reload(); props.reset?.(); }; // useLayoutEffect runs synchronously before browser paint, ensuring it's set early useLayoutEffect(() => { if (statusCode && typeof window !== "undefined") { window.CalComPageStatus = statusCode.toString(); } }, [statusCode]); return ( <>

{statusCode}

It's not you, it's us.

Something went wrong on our end. Get in touch with our support team, and we'll get it fixed right away for you.

Please provide the following text when contacting support to better help you:

              {message}
            
{displayDebug && (
)} ); };