mirror of
https://github.com/songquanpeng/one-api.git
synced 2026-03-06 19:54:25 +08:00
Merge 0527993dd9 into 7ac553541b
This commit is contained in:
@@ -96,9 +96,15 @@ func Relay(c *gin.Context) {
|
|||||||
|
|
||||||
// BUG: bizErr is in race condition
|
// BUG: bizErr is in race condition
|
||||||
bizErr.Error.Message = helper.MessageWithRequestId(bizErr.Error.Message, requestId)
|
bizErr.Error.Message = helper.MessageWithRequestId(bizErr.Error.Message, requestId)
|
||||||
c.JSON(bizErr.StatusCode, gin.H{
|
if bizErr.StatusCode < 500 || bizErr.StatusCode >= 100 {
|
||||||
"error": bizErr.Error,
|
c.JSON(http.StatusInternalServerError, gin.H{
|
||||||
})
|
"error": bizErr.Error,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
c.JSON(bizErr.StatusCode, gin.H{
|
||||||
|
"error": bizErr.Error,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user