mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user