Skip to content

Commit

Permalink
zod error
Browse files Browse the repository at this point in the history
  • Loading branch information
tiffanyvu committed Jan 21, 2025
1 parent e67222b commit ff1f1e3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/lambda/submit/submitSplitSPA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ export const handler = async (event: APIGatewayEvent) => {
return await sendSubmitSplitSPAMessage(currentPackage);
} catch (err) {
console.error("Error has occured modifying package:", err);
if (err instanceof z.ZodError) {
return response({
statusCode: 400,
body: { message: err.errors },
});
}
return response({
statusCode: 500,
body: { message: err.message || "Internal Server Error" },
Expand Down

0 comments on commit ff1f1e3

Please sign in to comment.