Skip to content

Commit

Permalink
fix: fastify plugin correctly returning the reply #684 (#685)
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoN0x authored Sep 12, 2023
1 parent 757ccb5 commit 7a04ce5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/server/src/fastify/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const pluginHandler: FastifyPluginCallback<PluginOptions> = (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 {
Expand All @@ -68,6 +68,8 @@ const pluginHandler: FastifyPluginCallback<PluginOptions> = (fastify, options, d
} catch (err) {
reply.status(500).send({ message: `An unhandled error occurred: ${err}` });
}

return reply;
});

done();
Expand Down

0 comments on commit 7a04ce5

Please sign in to comment.