Update the error message that the collection exceeds the upper limit (#23079)

Signed-off-by: SimFG <bang.fu@zilliz.com>
pull/23101/head
SimFG 2023-03-29 10:30:02 +08:00 committed by GitHub
parent 25706fc87a
commit 3e95df74f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -314,10 +314,10 @@ func (t *createCollectionTask) Execute(ctx context.Context) error {
log.Warn("fail to list collections for checking the collection count", zap.Error(err))
return fmt.Errorf("fail to list collections for checking the collection count")
}
if len(existedCollInfos) >= Params.QuotaConfig.MaxCollectionNum {
errMsg := "unable to create collection because the number of collection has reached the limit"
log.Error(errMsg, zap.Int("max_collection_num", Params.QuotaConfig.MaxCollectionNum))
return errors.New(errMsg)
maxCollectionNum := Params.QuotaConfig.MaxCollectionNum
if len(existedCollInfos) >= maxCollectionNum {
log.Error("unable to create collection because the number of collection has reached the limit", zap.Int("max_collection_num", maxCollectionNum))
return fmt.Errorf("failed to create collection, limit={%d}, exceeded the limit number of collections", maxCollectionNum)
}
undoTask := newBaseUndoTask(t.core.stepExecutor)