From cbd9eff66d82c3ab6448b5e2e53d8d233d56053c Mon Sep 17 00:00:00 2001 From: chyezh Date: Fri, 1 Nov 2024 15:12:22 +0800 Subject: [PATCH] fix: repeated error code in milvus and segcore Signed-off-by: chyezh --- internal/core/src/common/EasyAssert.h | 12 ++++++------ pkg/util/merr/errors.go | 7 +++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/internal/core/src/common/EasyAssert.h b/internal/core/src/common/EasyAssert.h index 763bd65a138a2..f604bd4a86ab3 100644 --- a/internal/core/src/common/EasyAssert.h +++ b/internal/core/src/common/EasyAssert.h @@ -64,13 +64,13 @@ enum ErrorCode { MemAllocateFailed = 2034, MemAllocateSizeNotMatch = 2035, MmapError = 2036, - OutOfRange = 2037, - GcpNativeError = 2038, - KnowhereError = 2100, + // timeout or cancel related + FollyOtherException = 2037, + FollyCancel = 2038, + OutOfRange = 2039, + GcpNativeError = 2040, - // timeout or cancel related. - FollyOtherException = 2200, - FollyCancel = 2201 + KnowhereError = 2099, }; namespace impl { void diff --git a/pkg/util/merr/errors.go b/pkg/util/merr/errors.go index 30bd26ec49f8f..a0cec3408096d 100644 --- a/pkg/util/merr/errors.go +++ b/pkg/util/merr/errors.go @@ -180,8 +180,11 @@ var ( ErrSegcore = newMilvusError("segcore error", 2000, false) ErrSegcoreUnsupported = newMilvusError("segcore unsupported error", 2001, false) ErrSegcorePretendFinished = newMilvusError("segcore pretend finished", 2002, false) - ErrSegcoreFollyOtherException = newMilvusError("segcore folly other exception", 2200, false) // throw from segcore. - ErrSegcoreFollyCancel = newMilvusError("segcore Future was canceled", 2201, false) // throw from segcore. + ErrSegcoreFollyOtherException = newMilvusError("segcore folly other exception", 2037, false) // throw from segcore. + ErrSegcoreFollyCancel = newMilvusError("segcore Future was canceled", 2038, false) // throw from segcore. + ErrSegcoreOutOfRange = newMilvusError("segcore out of range", 2039, false) // throw from segcore. + ErrSegcoreGCPNativeError = newMilvusError("segcore GCP native error", 2040, false) // throw from segcore. + KnowhereError = newMilvusError("knowhere error", 2099, false) // throw from segcore. // Do NOT export this, // never allow programmer using this, keep only for converting unknown error to milvusError