Skip to content

Commit

Permalink
Return appropriate error codes (#1665)
Browse files Browse the repository at this point in the history
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
  • Loading branch information
SleeplessOne1917 and dessalines committed Jun 28, 2023
1 parent 5c16be7 commit ef66dfa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/server/handlers/catch-all-handler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
}
}
Expand Down

0 comments on commit ef66dfa

Please sign in to comment.