mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 19:08:30 +08:00
Put errors together (#7958)
Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
c63086fefa
commit
c76f91233f
@ -16,6 +16,17 @@ import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// errNilKvClient stands for a nil kv client is detected when initialized
|
||||
var errNilKvClient = errors.New("kv client not initialized")
|
||||
|
||||
// serverNotServingErrMsg used for Status Reason when datacoord is not healthy
|
||||
const serverNotServingErrMsg = "server is not serving"
|
||||
|
||||
// errors for VerifyResponse
|
||||
var errNilResponse = errors.New("response is nil")
|
||||
var errNilStatusResponse = errors.New("response has nil status")
|
||||
var errUnknownResponseType = errors.New("unknown response type")
|
||||
|
||||
func msgDataCoordIsUnhealthy(coordID UniqueID) string {
|
||||
return fmt.Sprintf("data coord %d is not ready", coordID)
|
||||
}
|
||||
|
@ -58,8 +58,6 @@ type (
|
||||
Timestamp = typeutil.Timestamp
|
||||
)
|
||||
|
||||
var errNilKvClient = errors.New("kv client not initialized")
|
||||
|
||||
// ServerState type alias, presents datacoord Server State
|
||||
type ServerState = int64
|
||||
|
||||
|
@ -15,8 +15,6 @@ import (
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
const serverNotServingErrMsg = "server is not serving"
|
||||
|
||||
// checks whether server in Healthy State
|
||||
func (s *Server) isClosed() bool {
|
||||
return atomic.LoadInt64(&s.isServing) != ServerStateHealthy
|
||||
|
@ -25,10 +25,6 @@ type Response interface {
|
||||
GetStatus() *commonpb.Status
|
||||
}
|
||||
|
||||
var errNilResponse = errors.New("response is nil")
|
||||
var errNilStatusResponse = errors.New("response has nil status")
|
||||
var errUnknownResponseType = errors.New("unknown response type")
|
||||
|
||||
// VerifyResponse verify grpc Response 1. check error is nil 2. check response.GetStatus() with status success
|
||||
func VerifyResponse(response interface{}, err error) error {
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user