mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-10 08:03:41 +08:00
feat: print user id when error
This commit is contained in:
@@ -6,9 +6,10 @@ import (
|
||||
)
|
||||
|
||||
func abortWithOpenAiMessage(c *gin.Context, statusCode int, message string) {
|
||||
userId := c.GetInt("id")
|
||||
c.JSON(statusCode, gin.H{
|
||||
"error": gin.H{
|
||||
"message": common.MessageWithRequestId(message, c.GetString(common.RequestIdKey)),
|
||||
"message": common.MessageWithRequestId(message, c.GetString(common.RequestIdKey), userId),
|
||||
"type": "new_api_error",
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user