|
|
@@ -185,7 +185,7 @@ func Relay(c *gin.Context) {
|
|
|
channelId := c.GetInt("channel_id")
|
|
|
common.SysError(fmt.Sprintf("relay error (channel #%d): %s", channelId, err.Message))
|
|
|
// 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)
|