Reuse method JSONError

This commit is contained in:
Lunny Xiao 2024-04-30 15:24:56 +08:00
parent 03562c7ff7
commit 24c2c13c41
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A

View File

@ -277,5 +277,5 @@ func (ctx *Context) JSONServerError(msg string, err error) {
errorMessage = fmt.Sprintf("%s: %v", errorMessage, err)
}
}
ctx.JSON(http.StatusBadRequest, map[string]any{"errorMessage": errorMessage, "renderFormat": "text"})
ctx.JSONError(errorMessage)
}