UNPKG
ring-websites-toolbelt
Version:
latest (3.0.0)
3.0.0
2.1.0
2.0.4
2.0.3
2.0.2
2.0.1
2.0.0
Ring Publishing Platform tool to work with Ring Websites
ring-websites-toolbelt
/
lib
/
utils
/
retryPromise.js
16 lines
(12 loc)
•
277 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module
.
exports
=
async
function
retryPromise
(
promiseFn, retries
) {
let
error =
null
;
while
(retries >
0
) {
try
{
return
await
promiseFn
(); }
catch
(err) { error = err; retries--; } }
throw
error; }