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