mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-12-23 09:45:01 +00:00
Return appropriate error codes (#1665)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
This commit is contained in:
parent
5c16be767c
commit
ef66dfa6fd
|
@ -75,7 +75,12 @@ export default async (req: Request, res: Response) => {
|
|||
|
||||
routeData = await activeRoute.fetchInitialData(initialFetchReq);
|
||||
}
|
||||
|
||||
if (!activeRoute) {
|
||||
res.status(404);
|
||||
}
|
||||
} else if (try_site.state === "failed") {
|
||||
res.status(500);
|
||||
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") {
|
||||
return res.redirect(`/signup`);
|
||||
} else {
|
||||
res.status(500);
|
||||
errorPageData = getErrorPageData(new Error(error.msg), site);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue