# Command argument to cancel the whole build in case of fail

**URL:** <https://forum.buildkite.community/t/command-argument-to-cancel-the-whole-build-in-case-of-fail/587>\
**Category:** Features Requests\
**Created:** [July 2, 2019, 6:12pm UTC](https://forum.buildkite.community/t/command-argument-to-cancel-the-whole-build-in-case-of-fail/587 "2019-07-02T18:12:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dzenly](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/dzenly/32/569_2.png) [@Dzenly](https://forum.buildkite.community/u/Dzenly)\
**Post date:** [July 2, 2019, 6:12pm UTC](https://forum.buildkite.community/t/command-argument-to-cancel-the-whole-build-in-case-of-fail/587/1 "2019-07-02T18:12:25Z")

</div>

say

- command:
  - some subCommand  
hard\_fail: true

And if subCommand returns non zero - the whole bulid is cancelled and marked as failed.

The solution with “wait” between jobs works incorrectly for case where two different machines (which supposed to run in parallel) generate substeps.

---

<div class="post-metadata">

**Author:** ![anon18197598](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@anon18197598](https://forum.buildkite.community/u/anon18197598)\
**Post date:** [July 2, 2019, 10:56pm UTC](https://forum.buildkite.community/t/command-argument-to-cancel-the-whole-build-in-case-of-fail/587/2 "2019-07-02T22:56:42Z")

</div>

We refer to this idea as “fail fast”, we want to do it, but there are some complexities. Thanks for the suggestion, we’ll update if there is progress.
