Format errors better for CLI (#552)

* Start making errors easier to read for Table based CLI UI.

* Add TODO about reporting "update_mask" related errors.
This commit is contained in:
Todd Knight authored and GitHub committed 2020-10-06 14:08:49 -07:00
1 parent d6c6aea179
commit 6c6fb7a4d0
22 files changed
+90 -63

No files matched your search

@@ -127,8 +127,8 @@ func (c *PasswordCommand) Run(args []string) int {
"password": c.flagPassword,
})
if err != nil {
if api.AsServerError(err) != nil {
c.UI.Error(fmt.Sprintf("Error from controller when performing authentication: %s", err.Error()))
if apiErr := api.AsServerError(err); apiErr != nil {
c.UI.Error(fmt.Sprintf("Error from controller when performing authentication: %s", base.PrintApiError(apiErr)))
return 1
}
c.UI.Error(fmt.Sprintf("Error trying to perform authentication: %s", err.Error()))