Apify Discord Mirror

Updated 5 months ago

Throw error that respects maxRequestRetries

At a glance

The community member posted a question about how to throw an error that respects the maxRequestRetries when using RetryRequestError, which retries the request infinitely until it succeeds. Another community member suggested that throwing any non-child Error class should work, and provided an example of throwing a new Error with a message that will increase the request.retryCount. The other community members expressed appreciation for the response.

Hello,
With RetryRequestError, the request gets retried an infinite times until it succeeds, what error should I throw to respect the maxRequestRetries?
N
P
4 comments
can I kindly ask you to also help me here ?
Hi I believe that there may be only exception for RetryRequestError so if you throw any other non children Error class that should work.

Generally throw new Error('This will increase the request.retryCount') should be working.
ok, thank you
much appreciated !
Add a reply
Sign up and join the conversation on Discord