Skip to content

Commit

Permalink
fix: send 500 code if payload ingestion fails (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelcr committed Jun 28, 2023
1 parent 689196f commit 0a3fee2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/chainhook/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,11 @@ const Chainhook: FastifyPluginCallback<Record<never, never>, 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();
};
Expand Down

0 comments on commit 0a3fee2

Please sign in to comment.