mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-23 17:31:11 +01:00
JSON -> AbortWithStatusJSON
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user