mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-21 19:16:36 +08:00
refactor: Enhance error handling and logging in relay controller
- Update error logging in relay controller - Include error summary and request details in error log message - Improve formatting for more descriptive and comprehensive error log messages
This commit is contained in:
parent
a889d9dcc9
commit
287376dd97
@ -384,7 +384,7 @@ func Relay(c *gin.Context) {
|
||||
})
|
||||
}
|
||||
channelId := c.GetInt("channel_id")
|
||||
common.LogError(c.Request.Context(), fmt.Sprintf("relay error (channel #%d): %s", channelId, err.Message))
|
||||
common.LogError(c.Request.Context(), fmt.Sprintf("relay error (channel #%d): %+v", channelId, err))
|
||||
// https://platform.openai.com/docs/guides/error-codes/api-errors
|
||||
if shouldDisableChannel(&err.OpenAIError, err.StatusCode) {
|
||||
channelId := c.GetInt("channel_id")
|
||||
|
Loading…
Reference in New Issue
Block a user