This commit is contained in:
CaIon
2023-09-09 01:50:41 +08:00
parent fe94656260
commit 43be1982d7
5 changed files with 43 additions and 21 deletions

View File

@@ -207,7 +207,7 @@ func Relay(c *gin.Context) {
channelId := c.GetInt("channel_id")
common.SysError(fmt.Sprintf("relay error (channel #%d): %v ", channelId, err))
// https://platform.openai.com/docs/guides/error-codes/api-errors
if shouldDisableChannel(&err.OpenAIError) {
if shouldDisableChannel(&err.OpenAIError, err.StatusCode) {
channelId := c.GetInt("channel_id")
channelName := c.GetString("channel_name")
disableChannel(channelId, channelName, err.Message)