summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/api.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/api.js b/lib/api.js
index a531980..ae05c7f 100644
--- a/lib/api.js
+++ b/lib/api.js
@@ -68,7 +68,11 @@ function send_this(data) {
return data.resolve(response);})
.catch(err => {
fs.writeFileSync('log', JSON.stringify({event: 'error', date: new Date(), data: err}) + '\n', {flag: 'a+'});
- data.reject(err)});
+ if (err.cause?.code === 'UND_ERR_CONNECT_TIMEOUT') {
+ send_this(data);
+ } else {
+ data.reject(err)
+ }});
setTimeout(send_next, 500);
}