This commit is contained in:
Jozef Steinhübl 2024-04-02 11:45:21 +02:00
parent 932c3b236c
commit 090f970b70
3 changed files with 372 additions and 85 deletions

View file

@ -1,5 +1,8 @@
export function retry<T>(fn: () => Promise<T>, retries: number): Promise<T> {
return fn().catch((err) => {
console.log(`Remaining retries ${retries}`);
console.log("Current error:");
console.log(err);
if (retries <= 0) {
throw err;
}