Skip to content

Commit

Permalink
define err
Browse files Browse the repository at this point in the history
Signed-off-by: bigsheeper <[email protected]>
  • Loading branch information
bigsheeper committed Mar 18, 2024
1 parent f798a4b commit ecbd6ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions client/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
"github.com/milvus-io/milvus-sdk-go/v2/entity"
"github.com/milvus-io/milvus-sdk-go/v2/merr"
)

const (
Expand Down Expand Up @@ -80,7 +81,7 @@ func (c *GrpcClient) HybridSearch(ctx context.Context, collName string, partitio

r, err := RetryOnMilvusErrors(ctx, func() (interface{}, error) {
return c.Service.HybridSearch(ctx, req)
}, OnMerrCodes(2200))
}, OnMerrCodes(merr.Code(merr.ErrInconsistentRequery)))
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -122,7 +123,7 @@ func (c *GrpcClient) Search(ctx context.Context, collName string, partitions []s

r, err := RetryOnMilvusErrors(ctx, func() (interface{}, error) {
return c.Service.Search(ctx, req)
}, OnMerrCodes(2200))
}, OnMerrCodes(merr.Code(merr.ErrInconsistentRequery)))
if err != nil {
return nil, err
}
Expand Down
3 changes: 3 additions & 0 deletions merr/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ var (

// import
ErrImportFailed = newMilvusError("importing data failed", 2100, false)

// Search/Query related
ErrInconsistentRequery = newMilvusError("inconsistent requery result", 2200, true)
)

type milvusError struct {
Expand Down

0 comments on commit ecbd6ad

Please sign in to comment.