mirror of
https://github.com/elyby/accounts-profiles-endpoint.git
synced 2024-12-01 19:21: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)
|
||
|
}
|
||
|
}
|
||
|
}
|