TP-5555 | search addition
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user