Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fastify plugin correctly returning the reply #684 #685

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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