Skip to content

Commit 3e95df7

Browse files
authored
Update the error message that the collection exceeds the upper limit (#23079)
Signed-off-by: SimFG <bang.fu@zilliz.com>
1 parent 25706fc commit 3e95df7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/rootcoord/create_collection_task.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,10 @@ func (t *createCollectionTask) Execute(ctx context.Context) error {
314314
log.Warn("fail to list collections for checking the collection count", zap.Error(err))
315315
return fmt.Errorf("fail to list collections for checking the collection count")
316316
}
317-
if len(existedCollInfos) >= Params.QuotaConfig.MaxCollectionNum {
318-
errMsg := "unable to create collection because the number of collection has reached the limit"
319-
log.Error(errMsg, zap.Int("max_collection_num", Params.QuotaConfig.MaxCollectionNum))
320-
return errors.New(errMsg)
317+
maxCollectionNum := Params.QuotaConfig.MaxCollectionNum
318+
if len(existedCollInfos) >= maxCollectionNum {
319+
log.Error("unable to create collection because the number of collection has reached the limit", zap.Int("max_collection_num", maxCollectionNum))
320+
return fmt.Errorf("failed to create collection, limit={%d}, exceeded the limit number of collections", maxCollectionNum)
321321
}
322322

323323
undoTask := newBaseUndoTask(t.core.stepExecutor)

0 commit comments

Comments
 (0)