'How do I stop Newman to run a collection on certain response code?

I'm relatively new to this, How do I stop Newman to run a collection on certain response code? For example I want it to stop running on response 400 or 401 I tried the bail option but I guess I'm doing something wrong. Thanks for shedding some light.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source