Skip to content

Commit

Permalink
chore(error-pages): Cast only once
Browse files Browse the repository at this point in the history
  • Loading branch information
zechmeister committed Sep 3, 2024
1 parent 94cc4d8 commit 9c2bdd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/routes/error.$code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const loader = async ({ params }: LoaderFunctionArgs) => {
const errorCode = Number(params.code);
if ([502, 503, 504].includes(errorCode))
throw new Response("Simulated server error", {
status: Number(params.code),
status: errorCode,
});

throw new Response("Invalid error code", { status: 400 });
Expand Down

0 comments on commit 9c2bdd6

Please sign in to comment.