소스 검색

feat: update auto disable

[email protected] 1 년 전
부모
커밋
02c0c6501e
1개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  1. 9 0
      service/channel.go

+ 9 - 0
service/channel.go

@@ -73,6 +73,15 @@ func ShouldDisableChannel(channelType int, err *relaymodel.OpenAIErrorWithStatus
 	} else if strings.HasPrefix(err.Error.Message, "Permission denied") {
 		return true
 	}
+
+	if strings.Contains(err.Error.Message, "The security token included in the request is invalid") { // anthropic
+		return true
+	} else if strings.Contains(err.Error.Message, "Operation not allowed") {
+		return true
+	} else if strings.Contains(err.Error.Message, "Your account is not authorized") {
+		return true
+	}
+
 	return false
 }