diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api.js | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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); } |