diff --git a/apps/dokploy/pages/_error.tsx b/apps/dokploy/pages/_error.tsx index 8fd510796..4b1eeff4b 100644 --- a/apps/dokploy/pages/_error.tsx +++ b/apps/dokploy/pages/_error.tsx @@ -5,12 +5,11 @@ import { buttonVariants } from "@/components/ui/button"; import { useWhitelabelingPublic } from "@/utils/hooks/use-whitelabeling"; interface Props { - statusCode: number; - error?: Error; + statusCode?: number; } -export default function Custom404({ statusCode, error }: Props) { - const displayStatusCode = statusCode || 400; +export default function ErrorPage({ statusCode }: Props) { + const displayStatusCode = statusCode || 500; const { config: whitelabeling } = useWhitelabelingPublic(); const appName = whitelabeling?.appName || "Dokploy"; const logoUrl = whitelabeling?.logoUrl || undefined; @@ -45,12 +44,6 @@ export default function Custom404({ statusCode, error }: Props) { {errorDescription}

)} - {error && ( -
-

{error.message}

-
- )} -
{ - const statusCode = res ? res.statusCode : err ? err.statusCode : 404; - return { statusCode, error: err }; +ErrorPage.getInitialProps = ({ res, err }: NextPageContext) => { + const statusCode = res ? res.statusCode : err ? (err.statusCode ?? 500) : 404; + return { statusCode }; };