aboutsummaryrefslogtreecommitdiff
path: root/packages/server/src/app.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/server/src/app.ts')
-rw-r--r--packages/server/src/app.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/server/src/app.ts b/packages/server/src/app.ts
index 9ca3769..42d096a 100644
--- a/packages/server/src/app.ts
+++ b/packages/server/src/app.ts
@@ -11,6 +11,11 @@ export default function buildApp(settings: Settings): FastifyInstance {
const fastify = fastifyFactory();
fastify.setErrorHandler((err, req, reply) => {
+ if(err.validation) {
+ reply.code(400).send(`${err.validation[0].dataPath} ${err.validation[0].message}`);
+ return;
+ }
+
console.log(err);
reply.code(500).send("Internal server error!");
});