17 lines
228 B
Go
Raw Normal View History

2024-09-22 15:16:25 +02:00
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)
}
}
}