projects
/
lemmy-ui.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5c16be7
)
Return appropriate error codes (#1665)
author
SleeplessOne1917
<abias1122@gmail.com>
Wed, 28 Jun 2023 20:44:26 +0000
(16:44 -0400)
committer
GitHub
<noreply@github.com>
Wed, 28 Jun 2023 20:44:26 +0000
(16:44 -0400)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
src/server/handlers/catch-all-handler.tsx
patch
|
blob
|
history
diff --git
a/src/server/handlers/catch-all-handler.tsx
b/src/server/handlers/catch-all-handler.tsx
index f22b8a1734f55ed84475dc3d1bccb30045f9fd43..d485429cc032504a94e5d25ed12d956a5df7663b 100644
(file)
--- a/
src/server/handlers/catch-all-handler.tsx
+++ b/
src/server/handlers/catch-all-handler.tsx
@@
-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);
}
}