presidium 3.4.6 → 3.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
const sleep = require('./sleep')
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* @name RetryAwsErrors
|
|
3
5
|
*
|
|
@@ -9,8 +11,10 @@
|
|
|
9
11
|
|
|
10
12
|
const RetryAwsErrors = function (func, context, name) {
|
|
11
13
|
return function retriesAwsErrors(...args) {
|
|
12
|
-
return func.apply(context, args).catch(error => {
|
|
14
|
+
return func.apply(context, args).catch(async error => {
|
|
13
15
|
if (error.retryable) {
|
|
16
|
+
console.error(error)
|
|
17
|
+
await sleep(1000)
|
|
14
18
|
return retriesAwsErrors(...args)
|
|
15
19
|
}
|
|
16
20
|
throw error
|