From 268243d8a39324aa57de32767da39a6870c31246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=85=E5=AD=90?= Date: Sun, 14 Nov 2021 13:32:10 +0800 Subject: [PATCH] fix(cmd/new): print the correct error message (#1630) --- cmd/kratos/internal/project/project.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/kratos/internal/project/project.go b/cmd/kratos/internal/project/project.go index dd0a3c183..0abc45775 100644 --- a/cmd/kratos/internal/project/project.go +++ b/cmd/kratos/internal/project/project.go @@ -70,11 +70,11 @@ func run(cmd *cobra.Command, args []string) { if errors.Is(ctx.Err(), context.DeadlineExceeded) { fmt.Fprint(os.Stderr, "\033[31mERROR: project creation timed out\033[m\n") } else { - fmt.Fprintf(os.Stderr, "\033[31mERROR: failed to create project(%s)\033[m\n", ctx.Err()) + fmt.Fprintf(os.Stderr, "\033[31mERROR: failed to create project(%s)\033[m\n", ctx.Err().Error()) } case err = <-done: if err != nil { - fmt.Fprintf(os.Stderr, "\033[31mERROR: Failed to create project(%s)\033[m\n", ctx.Err()) + fmt.Fprintf(os.Stderr, "\033[31mERROR: Failed to create project(%s)\033[m\n", err.Error()) } } }