accounts-profiles-endpoint/internal/http/middlewares.go
2024-10-01 01:41:29 +02:00

17 lines
228 B
Go

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)
}
}
}