From 3672d2501842778a65508dbf8cba736ecd60892d Mon Sep 17 00:00:00 2001 From: morganelle Date: Fri, 5 Mar 2021 12:39:54 -0800 Subject: [PATCH] update errors for completion and logs --- internal/cli/completion.go | 8 ++++---- internal/cli/logs.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/cli/completion.go b/internal/cli/completion.go index 4de0aabb2..01adc31eb 100644 --- a/internal/cli/completion.go +++ b/internal/cli/completion.go @@ -57,22 +57,22 @@ PS> auth0 completion powershell > auth0.ps1 case "bash": err := cmd.Root().GenBashCompletion(os.Stdout) if err != nil { - cli.renderer.Errorf(err.Error()) + cli.renderer.Errorf("An unexpected error occurred while setting up completion: %v", err.Error()) } case "zsh": err := cmd.Root().GenZshCompletion(os.Stdout) if err != nil { - cli.renderer.Errorf(err.Error()) + cli.renderer.Errorf("An unexpected error occurred while setting up completion: %v", err.Error()) } case "fish": err := cmd.Root().GenFishCompletion(os.Stdout, true) if err != nil { - cli.renderer.Errorf(err.Error()) + cli.renderer.Errorf("An unexpected error occurred while setting up completion: %v", err.Error()) } case "powershell": err := cmd.Root().GenPowerShellCompletion(os.Stdout) if err != nil { - cli.renderer.Errorf(err.Error()) + cli.renderer.Errorf("An unexpected error occurred while setting up completion: %v", err.Error()) } } }, diff --git a/internal/cli/logs.go b/internal/cli/logs.go index e0ccfb8c8..0e02b868d 100644 --- a/internal/cli/logs.go +++ b/internal/cli/logs.go @@ -45,7 +45,7 @@ Show the tenant logs. lastLogID := "" list, err := getLatestLogs(cli, flags.Num) if err != nil { - return err + return fmt.Errorf("An unexpected error occurred while getting logs: %v", err) } // TODO(cyx): This is a hack for now to make the @@ -76,7 +76,7 @@ Show the tenant logs. management.Parameter("sort", "date:-1"), ) if err != nil { - cli.renderer.Errorf("Error: %v", err) + cli.renderer.Errorf("An unexpected error occurred while getting logs: %v", err) return }