From ba0471355b993fe2176ef035cbdd6170a3cdc5f4 Mon Sep 17 00:00:00 2001 From: yaziming Date: Mon, 26 Aug 2019 23:13:26 +0800 Subject: [PATCH] JSON -> AbortWithStatusJSON --- backend/routes/utils.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/routes/utils.go b/backend/routes/utils.go index 14c5853e..2b45c5f1 100644 --- a/backend/routes/utils.go +++ b/backend/routes/utils.go @@ -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,