Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #3786 fix issue when triggering an action that does not exist #3874

Merged
merged 2 commits into from
Aug 21, 2018

Conversation

wallet77
Copy link
Contributor

If action doesn't exist we should display an error, even if we trigger action by application's name.

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #3786
License MIT

@@ -801,6 +801,22 @@ module.exports = function(God) {

var proc_env = God.clusters_db[id].pm2_env;

var action_exist = false;
proc_env.axm_actions.forEach(function(action) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be refactored to a simpler code :

const isActionAvailable = proc_env.axm_actions.find(action => action.action_name === cmd.msg) !== undefined

There is console.log call also

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@wallet77 wallet77 merged commit e868f00 into development Aug 21, 2018
@wallet77 wallet77 deleted the trigger_no_action branch August 21, 2018 12:03
inerc pushed a commit to inerc/pm2 that referenced this pull request Feb 11, 2020
fix: Unitech#3786 fix issue when triggering an action that does not exist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants