Skip to content

Commit c7a221a

Browse files
committed
Fix message with application
1 parent d3dd253 commit c7a221a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

commands/common/actions_metadata.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ func (c ActionsMetadata) FindAction(actionName string, service ...string) (*mode
4242
return nil, fmt.Errorf("%d actions found with name '%s', please specify an application", len(match), actionName)
4343
}
4444

45-
return nil, fmt.Errorf("action '%s' not found", actionName)
45+
if application != "" {
46+
return nil, fmt.Errorf("action '%s' not found for application '%s'", actionName, application)
47+
}
48+
49+
return nil, fmt.Errorf("action '%s' not found. It should be one of %s", actionName, c.ActionsNames())
4650
}
4751

4852
func (c ActionsMetadata) ActionNeedsCriteria(actionName string, service ...string) bool {

commands/init_cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func (c *initHandler) initWorker(targetDir string, action string, workerName str
9090
actionMeta, err := actionsMeta.FindAction(action, application)
9191
if err != nil {
9292
log.Debug(fmt.Sprintf("Cannot not find action '%s': %+v", action, err))
93-
return fmt.Errorf("invalid action '%s' action should be one of: %s", action, actionsMeta.ActionsNames())
93+
return err
9494
}
9595

9696
generate := c.initGenerator(targetDir, workerName, projectKey, force, skipTests, actionMeta)

0 commit comments

Comments
 (0)