Skip to content

Commit

Permalink
Update Listener.ts (#1147)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashish-egov authored Jul 25, 2024
1 parent 0bb7cf7 commit 617e57e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions utilities/project-factory/src/server/kafka/Listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,15 @@ async function produceModifiedMessages(modifiedMessages: any[], topic: any) {
// Send payloads to the Kafka producer
producer.send(payloads, (err: any) => {
if (err) {
console.error(err);
logger.info('KAFKA :: PRODUCER :: Some Error Occurred ');
logger.error(`KAFKA :: PRODUCER :: Error : ${JSON.stringify(err)}`);
} else {
logger.info('KAFKA :: PRODUCER :: message sent successfully ');
}
});
} catch (error) {
console.error(error);
logger.error(`KAFKA :: PRODUCER :: Exception caught: ${JSON.stringify(error)}`);
throwError("COMMON", 400, "KAKFA_ERROR", "Some error occured in kafka"); // Re-throw the error after logging it
}
Expand Down

0 comments on commit 617e57e

Please sign in to comment.