Skip to main content
Version: 4.x.x

Retries


Retry request on error

Retries gives us possibility to send another request in case of previous failure. This way we can ensure that in some situation we can get successful response no matter of previous failures.

On the request, we can define number of attempts and the interval between subsequent requests. We can add these options on creation or through the dynamic setRetry and setRetryTime methods.


Example

const createUser = client.createRequest()({ endpoint: "/users", retry: 4, retryTime: DateInterval.second * 3 });

// OR

const newRequest = createUser.setRetry(1).setRetryTime(DateInterval.minute);