Skip to content

Commit

Permalink
#11 - Added changes according to feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Anders164a committed Oct 2, 2023
1 parent 8f9fbdb commit 11ec7b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/plugins/error.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ export default fastifyPlugin(async (fastify: FastifyInstance) => {
statusCode: 400,
});
}
const statusCode = error.statusCode ?? 500;

Check warning on line 28 in src/plugins/error.handler.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

return reply.status(error.statusCode ?? 500).send({
return reply.status(statusCode).send({
error: error.name,
errors: { _: [error.message] },
statusCode: error.statusCode,
Expand Down

0 comments on commit 11ec7b1

Please sign in to comment.