# Stop request after throwing exception in pre-request

**URL:** <https://community.postman.com/t/stop-request-after-throwing-exception-in-pre-request/390>\
**Category:** Help Hub\
**Tags:** pre-request, request\
**Created:** [December 3, 2017, 9:12am UTC](https://community.postman.com/t/stop-request-after-throwing-exception-in-pre-request/390 "2017-12-03T09:12:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stealth.pda](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@stealth.pda](https://community.postman.com/u/stealth.pda)\
**Post date:** [December 3, 2017, 9:12am UTC](https://community.postman.com/t/stop-request-after-throwing-exception-in-pre-request/390/1 "2017-12-03T09:12:02Z")

</div>

i trying to get some information in pre-request script in call another api. and i checking response and want to stop request if throw exception.  
now i receiving message but my request could not to stop and i sent request with wrong data.

how to stop request from pre-request?

---

<div class="post-metadata">

**Author:** ![Whersh](https://avatars.discourse-cdn.com/v4/letter/w/9d8465/32.png) [@Whersh](https://community.postman.com/u/Whersh)\
**Post date:** [November 3, 2023, 4:05pm UTC](https://community.postman.com/t/stop-request-after-throwing-exception-in-pre-request/390/2 "2023-11-03T16:05:21Z")

</div>

I know this has been here for awhile…but just wanted to give a proper response as there have been new developments around this.

For anyone just running across this issue as well

It looks like we are going to get this soon

> <https://github.com/postmanlabs/postman-app-support/issues/8929#issuecomment-1790189424>
>
> In many other softwares pre-request script usually can stop continuing main oper…ation. Such as in git pre-commit script we can stop commit operation if we want, what is expected. But in postman pre-request script we can not stop request which is illogical. So postman pre-request script does not use its potential. I have found several years old fallback by throwing error but it is not good solution because in collection runner there are many red lines.
> 
> I have data file with e.g. 30 iterations but I do now want to run each iteration for each request. Some request are simple so I can not write 30 alternatives of variable value. SO I would like to add conditions in some requests... e.g. pseudo code... 
> \`if (pm.info.iteration \> 10)
> pm.request.stop() // or pm.request.skip()\`
> 
> Is it hard to add this feature? Is it planned samewhen?

> …`pm.execution.skipRequest()` . This function when used in Pre-request scripts will not execute the request…
