Refine error of WaitForComponentStates (#13308)

Signed-off-by: dragondriver <jiquan.long@zilliz.com>
This commit is contained in:
dragondriver 2021-12-15 10:23:10 +08:00 committed by GitHub
parent 9051d64f47
commit 6ba7e81a81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,8 +88,10 @@ func WaitForComponentStates(ctx context.Context, service types.Component, servic
}
}
if !meet {
msg := fmt.Sprintf("WaitForComponentStates, not meet, %s current state:%d", serviceName, resp.State.StateCode)
return errors.New(msg)
return fmt.Errorf(
"WaitForComponentStates, not meet, %s current state: %s",
serviceName,
resp.State.StateCode.String())
}
return nil
}