Merge pull request #176 from yaziming/forked/develop

JSON -> AbortWithStatusJSON
This commit is contained in:
Marvin Zhang
2019-08-27 08:45:49 +08:00
committed by GitHub

View File

@@ -7,7 +7,7 @@ import (
func HandleError(statusCode int, c *gin.Context, err error) {
debug.PrintStack()
c.JSON(statusCode, Response{
c.AbortWithStatusJSON(statusCode, Response{
Status: "ok",
Message: "error",
Error: err.Error(),
@@ -16,7 +16,7 @@ func HandleError(statusCode int, c *gin.Context, err error) {
func HandleErrorF(statusCode int, c *gin.Context, err string) {
debug.PrintStack()
c.JSON(statusCode, Response{
c.AbortWithStatusJSON(statusCode, Response{
Status: "ok",
Message: "error",
Error: err,