From 55c55d84377dda53dcfc7a00bd8b06339113e932 Mon Sep 17 00:00:00 2001 From: Morgan <23509639+morganelle@users.noreply.github.com> Date: Fri, 9 Apr 2021 13:25:53 -0700 Subject: [PATCH] handle keyboard interrupts in login and tenants use cmds (#245) Co-authored-by: Rita Zerrizuela --- internal/cli/logout.go | 2 +- internal/cli/tenants.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/cli/logout.go b/internal/cli/logout.go index 91689f0ce..b6b2a3d7c 100644 --- a/internal/cli/logout.go +++ b/internal/cli/logout.go @@ -36,7 +36,7 @@ func logoutCmd(cli *cli) *cobra.Command { input := prompt.SelectInput("tenant", "Tenant:", "Tenant to logout", tenNames, tenNames[0], true) if err := prompt.AskOne(input, &selectedTenant); err != nil { - return fmt.Errorf("An unexpected error occurred: %w", err) + return handleInputError(err) } } else { requestedTenant := args[0] diff --git a/internal/cli/tenants.go b/internal/cli/tenants.go index a1dc3c623..8105b0ee8 100644 --- a/internal/cli/tenants.go +++ b/internal/cli/tenants.go @@ -71,7 +71,7 @@ func useTenantCmd(cli *cli) *cobra.Command { input := prompt.SelectInput("tenant", "Tenant:", "Tenant to activate", tenNames, tenNames[0], true) if err := prompt.AskOne(input, &selectedTenant); err != nil { - return fmt.Errorf("An unexpected error occurred: %w", err) + return handleInputError(err) } } else { requestedTenant := args[0]