# Retry on etimedout

**URL:** <https://community.postman.com/t/retry-on-etimedout/28380>\
**Category:** Help Hub\
**Tags:** tests, collections\
**Created:** [October 3, 2021, 9:47pm UTC](https://community.postman.com/t/retry-on-etimedout/28380 "2021-10-03T21:47:56Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![security-cosmologist](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/security-cosmologist/32/7059_2.png) [@security-cosmologist](https://community.postman.com/u/security-cosmologist)\
**Post date:** [October 4, 2021, 1:24pm UTC](https://community.postman.com/t/retry-on-etimedout/28380/2 "2021-10-04T13:24:53Z")

</div>

Hello @neoxedneox welcome to the community 👋

Arguably the best approach here might be to increase the timeout limit and try to prevent that error from happening in the first place.  
However, in case that’s not an option, there are few different options to look at.

The main problem is that inside Postman you won’t be able to reach the “tests” of your request and that might prevent you from making an assertion to reset the request because the request will throw an error.

`^ An error will cause the collection runner to stop`

**Option 1** ) You can use Newman, as Newman will not abort the run if there’s an error and the **tests** tab of the request will be reached.

> **[newman](https://www.npmjs.com/package/newman)**
>
> Command-line companion utility for Postman. Latest version: 6.0.0, last published: 2 months ago. Start using newman in your project by running \`npm i newman\`. There are 181 other projects in the npm registry using newman.

You can add the following snippet in your collection’s test tab:

```auto
if(!pm.response.code){
    console.log(request.name, "Failed, retrying now")
    postman.setNextRequest(request.name)
}

```

Basically, this will check if pm.response.code exists and if it doesn’t it will re-run the request  
_A thing to keep in mind, you may end up in an endless loop in case your requests error out every time, so it’s good to add some sort of retries amount to prevent executing the collection endlessly_

**Option 2)** You can try to implement the suggestion made in that thread, even though it is regarding ECONNRESET, pretty much the same approach should be suitable for ECONNTIMEDOUT

> [@Can we test/assert for ECONNRESET?](https://community.postman.com/t/can-we-test-assert-for-econnreset/25212):
>
> My question: A service we are testing should not accept requests with TLS 1.0 or 1.1 and it behaves correctly denying those connections. When send a request via postman and force it to use TLS 1.0 (or TLS1.1), what’s returned by postman is [image] Console shows: Error: read ECONNRESET is there an way to detect & test for this as the expected? so the test would pass.

---

_[View the full topic](https://community.postman.com/t/retry-on-etimedout/28380)._
