ts-retry icon indicating copy to clipboard operation
ts-retry copied to clipboard

retryUntilDefined retries also on error

Open heikkihiltunen opened this issue 1 year ago • 1 comments

retryUntilDefined and retryAsyncUntilDefined seem to retry also on error. Is there any way to make them retry only when undefined or null is returned but immediately bail out on any error?

heikkihiltunen avatar Sep 05 '24 07:09 heikkihiltunen

Currently stopping on error is not a feature provided by the API. You may achieve the desire bahvoir by providing an onError function in the options. If the onError throws an error, this should prevent retry. I'll be thinking to a proper way to do this for a further release.

franckLdx avatar Sep 07 '24 16:09 franckLdx