TP-5555 | search addition

This commit is contained in:
varnit goyal
2025-01-09 16:06:55 +05:30
parent 3bd26de65a
commit 5a32a8acee
4 changed files with 21 additions and 6 deletions

View File

@@ -15,7 +15,6 @@ import (
"encoding/json"
"fmt"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
"gorm.io/gorm"
"net/http"
)
@@ -120,7 +119,7 @@ func (exceptionService *ExceptionService) CatchErrors(c *gin.Context) {
//ensure we are processing a valid payload
if len(lines) <= 2 {
exceptionService.logger.Error("payload is not valid", zap.Strings("payload", lines))
//exceptionService.logger.Error("payload is not valid", zap.Strings("payload", lines))
c.JSON(http.StatusOK, gin.H{"status": "payload is not valid"})
return
}
@@ -145,6 +144,7 @@ func (exceptionService *ExceptionService) CatchErrors(c *gin.Context) {
err := exceptionService.kafkaProducer.PublishEvent(errorItem, exceptionService.kafkaConfig.Topic, "", nil, encoder.JsonEncoderInstance)
if err != nil {
exceptionService.logger.Error("Error publishing exception to Kafka: " + err.Error())
fmt.Println("Failed to push error to kafka")
}
}