# How to stop Collection Runner on error?

**URL:** <https://community.postman.com/t/how-to-stop-collection-runner-on-error/12647>\
**Category:** Help Hub\
**Tags:** scripts, collection-runner\
**Created:** [May 14, 2020, 8:40am UTC](https://community.postman.com/t/how-to-stop-collection-runner-on-error/12647 "2020-05-14T08:40:44Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![Merricat](https://avatars.discourse-cdn.com/v4/letter/m/8dc957/32.png) [@Merricat](https://community.postman.com/u/Merricat)\
**Post date:** [September 5, 2021, 7:47pm UTC](https://community.postman.com/t/how-to-stop-collection-runner-on-error/12647/15 "2021-09-05T19:47:39Z")

</div>

Thanks @kclausing , that really helped me too!  
The one thing I noticed, however, is that if you have other tests in the same request, they will still be executed. In my case, I added the `setNextRequest(null)` and `setNextRequest()` in both, so while the first test failed, the second passed and allowed the collection to continue.

My solution so far has been to add a `bool` flag, and setting it to `false` whenever we call `setNextRequest(null)`, and to `true` when calling `setNextRequest()`. Then we add `pm.expect(my_bool).to.be.true` at the beginning of each additional test, so they can fail and return immediately.

---

_[View the full topic](https://community.postman.com/t/how-to-stop-collection-runner-on-error/12647)._
