Postman script - how to continue next step on intentional socket resets to IPs

I’m running a postman collection that runs a reset command against multiple IPs. The reset command closes the connection (as designed) because it is causing a reboot of the device.

I’d like my collection to continue to loop through the other IPs in the list when this happens but it is dying after the first one. How do I handle the socket reset and keep going?

Here’s my Tests tab:

var scrIPs = pm.environment.get("scrIPs");
if(scrIPs && scrIPs.length > 0){
} else {

My Pre-Request Script:

var scrIPs = pm.environment.get("scrIPs");

if(!scrIPs) {
    scrIPs = ["IP ADDRESS #1", "IP ADDRESS #2", "etc",];

var currentSCRip = scrIPs.shift();

And my Body:


My Post command is http://{{scrIP}}:986

The first IP will be called and then the script dies because of the Socket reset - I want to ignore that and continue with all the other IPs in my list until the entire list is done.

Being new to Postman/postscript I figure I have to catch/throw - but can someone assist me with the above script?

For some reason, the body part left out all the XML code - RESETREQUESTED

You mentioned you’re using {{scrIP}} in the tests tab.
Where does this value come from? I can see you’re setting a value called scrIPs (note the s)

Just to clarify, you can’t use the double curly bracer syntax to call environment variables in the Tests tab.
You can use this everywhere apart from the Pre-Request and Tests tabs.