fix(cmd/new): print the correct error message (#1630)

pull/1633/head
包子 3 years ago committed by GitHub
parent 780a6c0527
commit 268243d8a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      cmd/kratos/internal/project/project.go

@ -70,11 +70,11 @@ func run(cmd *cobra.Command, args []string) {
if errors.Is(ctx.Err(), context.DeadlineExceeded) { if errors.Is(ctx.Err(), context.DeadlineExceeded) {
fmt.Fprint(os.Stderr, "\033[31mERROR: project creation timed out\033[m\n") fmt.Fprint(os.Stderr, "\033[31mERROR: project creation timed out\033[m\n")
} else { } 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: case err = <-done:
if err != nil { 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())
} }
} }
} }

Loading…
Cancel
Save