fn should show API errors messages (#450)

* fn should show API errors messages

* update functions_go

* update functions_go lock
This commit is contained in:
Pedro Nasser
2016-12-19 16:30:18 -02:00
committed by GitHub
parent 0359842c30
commit 5a6ebb4e2f
4 changed files with 33 additions and 4 deletions

View File

@@ -184,6 +184,10 @@ func (a *routesCmd) list(c *cli.Context) error {
return fmt.Errorf("error getting routes: %v", err)
}
if msg := wrapper.Error_.Message; msg != "" {
return errors.New(msg)
}
baseURL, err := url.Parse(a.Configuration.BasePath)
if err != nil {
return fmt.Errorf("error parsing base path: %v", err)
@@ -338,8 +342,9 @@ func (a *routesCmd) create(c *cli.Context) error {
if err != nil {
return fmt.Errorf("error creating route: %v", err)
}
if wrapper.Route.Path == "" || wrapper.Route.Image == "" {
return fmt.Errorf("could not create this route (%s at %s), check if route path is correct", route, appName)
if msg := wrapper.Error_.Message; msg != "" {
return errors.New(msg)
}
fmt.Println(wrapper.Route.Path, "created with", wrapper.Route.Image)