invite error handling (#67)

This commit is contained in:
Michael Quigley 2022-09-27 15:19:01 -04:00
parent 222a494dbf
commit c739a2da69
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62

View File

@ -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)
}