1808837298@qq.com преди 1 година
родител
ревизия
e3f66807ee
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3 1
      service/channel.go

+ 3 - 1
service/channel.go

@@ -31,7 +31,7 @@ func ShouldDisableChannel(err *relaymodel.OpenAIError, statusCode int) bool {
 	if err == nil {
 		return false
 	}
-	if statusCode == http.StatusUnauthorized {
+	if statusCode == http.StatusUnauthorized || statusCode == http.StatusForbidden {
 		return true
 	}
 	switch err.Code {
@@ -59,6 +59,8 @@ func ShouldDisableChannel(err *relaymodel.OpenAIError, statusCode int) bool {
 		return true
 	} else if strings.HasPrefix(err.Message, "You exceeded your current quota") {
 		return true
+	} else if strings.HasPrefix(err.Message, "Permission denied") {
+		return true
 	}
 	return false
 }