From c739a2da6949762ea667cefa986dd45e05d84407 Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Tue, 27 Sep 2022 15:19:01 -0400 Subject: [PATCH] invite error handling (#67) --- cmd/zrok/invite.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/zrok/invite.go b/cmd/zrok/invite.go index 09996121..17fd1222 100644 --- a/cmd/zrok/invite.go +++ b/cmd/zrok/invite.go @@ -37,11 +37,14 @@ func (cmd *inviteCommand) run(_ *cobra.Command, _ []string) { panic(err) } if confirm != email { - fmt.Println("entered emails do not match... aborting!") + showError("entered emails do not match... aborting!", nil) } zrok, err := newZrokClient(apiEndpoint) if err != nil { + if !panicInstead { + showError("error creating zrok api client", err) + } panic(err) } req := identity.NewCreateAccountParams() @@ -50,6 +53,9 @@ func (cmd *inviteCommand) run(_ *cobra.Command, _ []string) { } _, err = zrok.Identity.CreateAccount(req) if err != nil { + if !panicInstead { + showError("error creating account", err) + } panic(err) }