How to stop execution of a Cucumber feature if any of the scenarios had failed

If I have 10 scenarios in a feature file and if one scenario fails then I want to stop executing or proceeding with next scenario. I want to terminate the execution for that particular feature file. How can I do that in Java?