fix: wrong error handling when call importv2 (#41664)

issue: #41654

Signed-off-by: chyezh <chyezh@outlook.com>
This commit is contained in:
Zhen Ye 2025-05-07 15:18:52 +08:00 committed by GitHub
parent 0dee3ccfd7
commit 05eb17aebc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1838,6 +1838,10 @@ func (s *Server) ImportV2(ctx context.Context, in *internalpb.ImportRequestInter
return importFile
})
importCollectionInfo, err := s.handler.GetCollection(ctx, in.GetCollectionID())
if errors.Is(err, merr.ErrCollectionNotFound) {
resp.Status = merr.Status(merr.WrapErrCollectionNotFound(in.GetCollectionID()))
return resp, nil
}
if err != nil {
resp.Status = merr.Status(merr.WrapErrImportFailed(fmt.Sprint("get collection failed, err=%w", err)))
return resp, nil