accounts-profiles-endpoint/internal/http/middlewares.go

17 lines
228 B
Go
Raw Normal View History

2024-09-22 18:46:25 +05:30
package http
import (
"net/http"
"github.com/gin-gonic/gin"
)
func ErrorMiddleware() gin.HandlerFunc {
return func(c *gin.Context) {
c.Next()
if len(c.Errors) > 0 {
c.Status(http.StatusInternalServerError)
}
}
}