From e34c4016e1379f34e75f1f18656fe58819540acd Mon Sep 17 00:00:00 2001 From: NeoN0x <1714902+NeoN0x@users.noreply.github.com> Date: Tue, 12 Sep 2023 23:10:37 +0200 Subject: [PATCH] fix: fastify plugin correctly returning the reply #684 --- packages/server/src/fastify/plugin.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/server/src/fastify/plugin.ts b/packages/server/src/fastify/plugin.ts index 4b86eec4b..02f5f341a 100644 --- a/packages/server/src/fastify/plugin.ts +++ b/packages/server/src/fastify/plugin.ts @@ -50,7 +50,7 @@ const pluginHandler: FastifyPluginCallback = (fastify, options, d const prisma = (await options.getPrisma(request, reply)) as DbClientContract; if (!prisma) { reply.status(500).send({ message: 'unable to get prisma from request context' }); - return; + return reply; } try { @@ -68,6 +68,8 @@ const pluginHandler: FastifyPluginCallback = (fastify, options, d } catch (err) { reply.status(500).send({ message: `An unhandled error occurred: ${err}` }); } + + return reply; }); done();