Skip to content

Commit dbca4f2

Browse files
committed
fix(webapp): map malformed JSON body to 400 in fail-deployment action
1 parent a2e9e80 commit dbca4f2

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

apps/webapp/app/routes/api.v1.deployments.$deploymentId.fail.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ export async function action({ request, params }: ActionFunctionArgs) {
5252
);
5353
} catch (error) {
5454
if (error instanceof Response) throw error;
55+
if (error instanceof SyntaxError) {
56+
return json({ error: "Invalid JSON body" }, { status: 400 });
57+
}
5558
logger.error("Failed to fail deployment", { error });
5659
return json({ error: "Internal Server Error" }, { status: 500 });
5760
}

0 commit comments

Comments
 (0)