I’m attempting to retry a URL call on a network failure error using the ‘cockatiel’ package.
The code that I wrote is as follows:-
import { retry, handleType, ExponentialBackoff} from 'cockatiel';
const response = await retry(
handleType(NetworkError),
{ maxAttempts: this.maxAttempt, backoff: new ExponentialBackoff({ maxDelay:this.maxDelayMs, initialDelay: this.initialDelayMs }) },
).execute() as HttpResponse;
return response;
}
I cannot locate a package that I may import in order to utilize “NetworkError.”
Where do I import ‘NetworkError’ from?
The cockatiel package version is “3.1.3” while my node version is “v18.20.1”