From 6ba7e81a810e8d048e565c0c5dac8560c96ed017 Mon Sep 17 00:00:00 2001 From: dragondriver Date: Wed, 15 Dec 2021 10:23:10 +0800 Subject: [PATCH] Refine error of WaitForComponentStates (#13308) Signed-off-by: dragondriver --- internal/util/funcutil/func.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/util/funcutil/func.go b/internal/util/funcutil/func.go index 3e211adb36..221411da44 100644 --- a/internal/util/funcutil/func.go +++ b/internal/util/funcutil/func.go @@ -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 }