Skip to content

Commit

Permalink
errorHandlerPlugin: eslint issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
nirnejak committed Nov 23, 2024
1 parent 87fe7cd commit ec4c084
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/plugins/errorHandlerPlugin.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { FastifyInstance } from "fastify"
import { type FastifyInstance } from "fastify"

async function errorHandlerPlugin(fastify: FastifyInstance) {
async function errorHandlerPlugin(fastify: FastifyInstance): Promise<void> {
fastify.setErrorHandler((error, request, reply) => {
request.log.error(error)

if (error.validation) {
if (error.validation !== null) {
reply.status(400).send({
error: "Validation Error",
message: error.message,
Expand Down

0 comments on commit ec4c084

Please sign in to comment.