promise-retry: debug retry errors
This commit is contained in:
@@ -17,6 +17,7 @@ async function promiseRetry(options, asyncFunction) {
|
||||
return await asyncFunction();
|
||||
} catch (error) {
|
||||
if (i === times - 1) throw error;
|
||||
if (options.debug) options.debug(`Attempt ${i+1} failed. Will retry: ${error.message}`);
|
||||
await delay(interval);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user