mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-29 15:51:14 +00:00
Return appropriate error codes
This commit is contained in:
parent
314aa796c0
commit
0ea9b72242
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);
|
||||
}
|
||||
|
||||
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