Skip to content

Commit

Permalink
changed 500 to 400 errros
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleysmithTTD committed Nov 25, 2024
1 parent cb16219 commit 9eec5ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const handleEmailPromptSubmission: RequestHandler<{}, z.infer<typeof EmailPrompt
EmailPromptRequest.parse(req.body);
} catch (e) {
logger.log('error', 'error while parsing the request');
_next(createError(500));
_next(createError(400));
return;
}
const {
Expand Down Expand Up @@ -149,7 +149,7 @@ const defaultRouteHandler: RequestHandler<{}, {}, z.infer<typeof DefaultRouteReq
requestStep = DefaultRouteRequest.parse(req.body).step;
} catch (e) {
logger.log('error', 'error while parsing step');
next(createError(500));
next(createError(400));
return;
}

Expand All @@ -158,7 +158,7 @@ const defaultRouteHandler: RequestHandler<{}, {}, z.infer<typeof DefaultRouteReq
await handler(req, res, next);
} else {
logger.log('error', 'no step');
next(createError(500));
next(createError(400));
}
};

Expand Down

0 comments on commit 9eec5ad

Please sign in to comment.