Reputation: 1275
I'm trying to check some file conditions inside change-content trigger and cancel the submit based on that condition.
If my trigger fails the operation is still submited to the server. How can I prevent submit?
Any help is much appreciated!
update:
I was using nodejs script as a trigger, exception is not enought to prevent a submit operation. There should be process.exit(1)
.
Upvotes: 1
Views: 132
Reputation: 71464
Your trigger needs to return a non-zero exit code in order to fail the calling operation.
Make sure that the trigger is blocking and returning its status code to the caller, rather than returning zero and forking so it can run asynchronously.
Note that triggers that run after the fact (like change-commit
) can't block an operation, but change-content
should be able to prevent a submit from finishing.
Upvotes: 1