mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-08 17:53:41 +08:00
fix: Improve relay error logging
- Log errors with the channel ID and the error message. - Also log errors with the channel ID and a JSON representation of the error.
This commit is contained in:
@@ -50,7 +50,7 @@ func Relay(c *gin.Context) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
channelId := c.GetInt("channel_id")
|
channelId := c.GetInt("channel_id")
|
||||||
logger.Error(c.Request.Context(), fmt.Sprintf("relay error (channel #%d): %s", channelId, err.Message))
|
logger.Error(c.Request.Context(), fmt.Sprintf("relay error (channel #%d): %+v", channelId, err))
|
||||||
// https://platform.openai.com/docs/guides/error-codes/api-errors
|
// https://platform.openai.com/docs/guides/error-codes/api-errors
|
||||||
if util.ShouldDisableChannel(&err.Error, err.StatusCode) {
|
if util.ShouldDisableChannel(&err.Error, err.StatusCode) {
|
||||||
channelId := c.GetInt("channel_id")
|
channelId := c.GetInt("channel_id")
|
||||||
|
|||||||
Reference in New Issue
Block a user