Add error logging in middleware
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -3,6 +3,7 @@ package middleware
|
||||
import (
|
||||
"git.itzana.me/strafesnet/go-grpc/dev"
|
||||
"github.com/gin-gonic/gin"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"google.golang.org/grpc"
|
||||
"net/http"
|
||||
"strconv"
|
||||
@@ -40,6 +41,9 @@ func ValidateRequest(service, permission string, conn *grpc.ClientConn) gin.Hand
|
||||
if err != nil {
|
||||
ctx.JSON(http.StatusInternalServerError, gin.H{"error": ErrMsgInternalServer})
|
||||
ctx.Abort()
|
||||
log.WithError(err).Error(
|
||||
"failed to validate API key",
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user