From 9191d5e10f5ec11bc652596b3a36ade1541ad06c Mon Sep 17 00:00:00 2001 From: Rafael Cardenas Date: Wed, 28 Jun 2023 14:14:45 -0600 Subject: [PATCH] fix: send 500 code if payload ingestion fails --- src/chainhook/server.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chainhook/server.ts b/src/chainhook/server.ts index 14e6db5c..905d475c 100644 --- a/src/chainhook/server.ts +++ b/src/chainhook/server.ts @@ -124,10 +124,11 @@ const Chainhook: FastifyPluginCallback, Server, TypeBoxType fastify.post('/chainhook/inscription_feed', async (request, reply) => { try { await processInscriptionFeed(request.body, fastify.db); + await reply.code(200).send(); } catch (error) { logger.error(error, `EventServer error processing inscription_feed`); + await reply.code(500).send(); } - await reply.code(200).send(); }); done(); };