middlewares/middlewares.go
func ErrorHandler(c *gin.Context) {
	c.Next()

	// TODO: Handle it in a better way
	if len(c.Errors) > 0 {
		c.HTML(http.StatusBadRequest, "400", gin.H{
			"errors": c.Errors,
		})
	}
}
func ErrorHandler(c *gin.Context) {
	c.Next()

	// TODO: Handle it in a better way
	if len(c.Errors) > 0 {
		c.HTML(http.StatusBadRequest, "400", gin.H{
			"errors": c.Errors,
		})
	}
}
func ErrorHandler ( c * gin . Context ) { c . Next ( ) // TODO: Handle it in a better way if len ( c . Errors ) > 0 { c . HTML ( http . StatusBadRequest , " " , gin . H { " " : c . Errors , } ) } }
// ErrorHandler is a middleware to handle errors encountered during requests
ErrorHandler is a middleware to handle errors encountered during requests