CaIon 1 год назад
Родитель
Сommit
be4809b95a
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      controller/relay.go

+ 2 - 2
controller/relay.go

@@ -124,7 +124,7 @@ func shouldRetry(c *gin.Context, channelId int, openaiErr *dto.OpenAIErrorWithSt
 
 
 func processChannelError(c *gin.Context, channelId int, err *dto.OpenAIErrorWithStatusCode) {
 func processChannelError(c *gin.Context, channelId int, err *dto.OpenAIErrorWithStatusCode) {
 	autoBan := c.GetBool("auto_ban")
 	autoBan := c.GetBool("auto_ban")
-	common.LogError(c.Request.Context(), fmt.Sprintf("relay error (channel #%d): %s", channelId, err.Error.Message))
+	common.LogError(c.Request.Context(), fmt.Sprintf("relay error (channel #%d, status code: %d): %s", channelId, err.StatusCode, err.Error.Message))
 	if service.ShouldDisableChannel(&err.Error, err.StatusCode) && autoBan {
 	if service.ShouldDisableChannel(&err.Error, err.StatusCode) && autoBan {
 		channelName := c.GetString("channel_name")
 		channelName := c.GetString("channel_name")
 		service.DisableChannel(channelId, channelName, err.Error.Message)
 		service.DisableChannel(channelId, channelName, err.Error.Message)
@@ -160,7 +160,7 @@ func RelayMidjourney(c *gin.Context) {
 			"code":        err.Code,
 			"code":        err.Code,
 		})
 		})
 		channelId := c.GetInt("channel_id")
 		channelId := c.GetInt("channel_id")
-		common.SysError(fmt.Sprintf("relay error (channel #%d): %s", channelId, fmt.Sprintf("%s %s", err.Description, err.Result)))
+		common.LogError(c, fmt.Sprintf("relay error (channel #%d, status code %d): %s", channelId, statusCode, fmt.Sprintf("%s %s", err.Description, err.Result)))
 	}
 	}
 }
 }