From 11892f79b65abb797cc4cf952aef7f502470d4a7 Mon Sep 17 00:00:00 2001 From: AgustinSRG Date: Sun, 14 Jan 2024 17:24:49 +0100 Subject: [PATCH] Fix issue for data downloader If a request fails, it will get stuck in an invalid state. This fixes the error. --- package-lock.json | 4 ++-- package.json | 2 +- src/data.js | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index d74f5b8..988a00a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "showdown-chatbot", - "version": "2.10.0", + "version": "2.10.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "showdown-chatbot", - "version": "2.10.0", + "version": "2.10.1", "license": "MIT", "dependencies": { "busboy": "1.6.0", diff --git a/package.json b/package.json index 5a640b7..8091a8f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "showdown-chatbot", - "version": "2.10.0", + "version": "2.10.1", "author": { "name": "Agustin San Roman", "email": "agustinsanromanguzman@gmail.com", diff --git a/src/data.js b/src/data.js index cdde2f8..538b680 100644 --- a/src/data.js +++ b/src/data.js @@ -277,6 +277,7 @@ class DataManager { wget(Showdown_Data[this.cur].url, function (data, err) { if (err) { this.events.emit('msg', "Error: Failed to download " + Showdown_Data[this.cur].url + " | (" + err.code + ") " + err.messaage); + this.nextDownload(); return; } FileSystem.writeFile(Path.resolve(this.path, Showdown_Data[this.cur].file), data, function (err2) {