Return appropriate error codes (#1665)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
This commit is contained in:
parent
5c16be767c
commit
ef66dfa6fd
1 changed files with 6 additions and 0 deletions
|
@ -75,7 +75,12 @@ export default async (req: Request, res: Response) => {
|
||||||
|
|
||||||
routeData = await activeRoute.fetchInitialData(initialFetchReq);
|
routeData = await activeRoute.fetchInitialData(initialFetchReq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!activeRoute) {
|
||||||
|
res.status(404);
|
||||||
|
}
|
||||||
} else if (try_site.state === "failed") {
|
} else if (try_site.state === "failed") {
|
||||||
|
res.status(500);
|
||||||
errorPageData = getErrorPageData(new Error(try_site.msg), site);
|
errorPageData = getErrorPageData(new Error(try_site.msg), site);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,6 +94,7 @@ export default async (req: Request, res: Response) => {
|
||||||
if (error.msg === "instance_is_private") {
|
if (error.msg === "instance_is_private") {
|
||||||
return res.redirect(`/signup`);
|
return res.redirect(`/signup`);
|
||||||
} else {
|
} else {
|
||||||
|
res.status(500);
|
||||||
errorPageData = getErrorPageData(new Error(error.msg), site);
|
errorPageData = getErrorPageData(new Error(error.msg), site);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue