mirror of
https://github.com/elyby/accounts-profiles-endpoint.git
synced 2024-11-29 18:22:02 +05:30
17 lines
228 B
Go
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)
|
|
}
|
|
}
|
|
}
|