mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-20 18:46:38 +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:
parent
b9972e0aa4
commit
d22c22d4f0
@ -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")
|
||||||
|
Loading…
Reference in New Issue
Block a user