fix: reply with 500 on payload processing error

This commit is contained in:
Rafael Cardenas
2023-06-28 21:14:45 -06:00
parent 5b421245cc
commit eaa6d7b640

View File

@@ -179,11 +179,11 @@ export async function buildServer(
async (request, reply) => {
try {
await callback(request.params.uuid, request.body);
await reply.code(200).send();
} catch (error) {
logger.error(error, `ChainhookEventObserver error processing payload`);
await reply.code(422).send();
await reply.code(500).send();
}
await reply.code(200).send();
}
);
done();