postman-app-support
postman-app-support copied to clipboard
Pre-request scripts will not mutate variables if error is thrown
Is there an existing issue for this?
- [X] I have searched the tracker for existing similar issues and I know that duplicates will be closed
Describe the Issue
In a pre-request script, if you throw an error, postman will not set any variables.
Steps To Reproduce
- Create a new workspace with an environment and a request.
- In the request, navigate to the scripts tab and set the following for a pre-request script:
pm.environment.set("TestVar", "This is a test");
throw new Error("Test");
- Run the request.
- No variables will have been created / mutated in the associated environment.
Screenshots or Videos
No response
Operating System
Windows
Postman Version
11.10.0
Postman Platform
Postman App
User Account Type
Signed In User
Additional Context?
No response