File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,12 +5,11 @@ import { buttonVariants } from "@/components/ui/button";
55import { useWhitelabelingPublic } from "@/utils/hooks/use-whitelabeling" ;
66
77interface Props {
8- statusCode : number ;
9- error ?: Error ;
8+ statusCode ?: number ;
109}
1110
12- export default function Custom404 ( { statusCode, error } : Props ) {
13- const displayStatusCode = statusCode || 400 ;
11+ export default function ErrorPage ( { statusCode } : Props ) {
12+ const displayStatusCode = statusCode || 500 ;
1413 const { config : whitelabeling } = useWhitelabelingPublic ( ) ;
1514 const appName = whitelabeling ?. appName || "Dokploy" ;
1615 const logoUrl = whitelabeling ?. logoUrl || undefined ;
@@ -45,12 +44,6 @@ export default function Custom404({ statusCode, error }: Props) {
4544 { errorDescription }
4645 </ p >
4746 ) }
48- { error && (
49- < div className = "mt-3 text-red-500" >
50- < p > { error . message } </ p >
51- </ div >
52- ) }
53-
5447 < div className = "mt-5 flex flex-col justify-center items-center gap-2 sm:flex-row sm:gap-3" >
5548 < Link
5649 href = "/dashboard/home"
@@ -101,8 +94,7 @@ export default function Custom404({ statusCode, error }: Props) {
10194 ) ;
10295}
10396
104- // @ts -ignore
105- Error . getInitialProps = ( { res, err } : NextPageContext ) => {
106- const statusCode = res ? res . statusCode : err ? err . statusCode : 404 ;
107- return { statusCode, error : err } ;
97+ ErrorPage . getInitialProps = ( { res, err } : NextPageContext ) => {
98+ const statusCode = res ? res . statusCode : err ? ( err . statusCode ?? 500 ) : 404 ;
99+ return { statusCode } ;
108100} ;
You can’t perform that action at this time.
0 commit comments