update response.go
This commit is contained in:
1 parent
50676cad7c
commit
b7d0e58ebf
1 file changed
+15
@@ -0,0 +1,15 @@
|
|||||||
|
package util
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
|
)
|
||||||
|
|
||||||
|
type error struct {
|
||||||
|
Message string `json:"message"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewErrorResponse(c *gin.Context, statusCode int, message string) {
|
||||||
|
logrus.Error(message)
|
||||||
|
c.AbortWithStatusJSON(statusCode, error{Message: message})
|
||||||
|
}
|
||||||
Reference in new issue
Block a user