Add error logging in middleware
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2025-06-22 13:47:17 -04:00
parent fecfc520a8
commit 2f3406d958

View File

@@ -3,6 +3,7 @@ package middleware
import ( import (
"git.itzana.me/strafesnet/go-grpc/dev" "git.itzana.me/strafesnet/go-grpc/dev"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus"
"google.golang.org/grpc" "google.golang.org/grpc"
"net/http" "net/http"
"strconv" "strconv"
@@ -40,6 +41,9 @@ func ValidateRequest(service, permission string, conn *grpc.ClientConn) gin.Hand
if err != nil { if err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{"error": ErrMsgInternalServer}) ctx.JSON(http.StatusInternalServerError, gin.H{"error": ErrMsgInternalServer})
ctx.Abort() ctx.Abort()
log.WithError(err).Error(
"failed to validate API key",
)
return return
} }