From 3c2b73794ab4619b60933255b0ffa6e0f6d51cfe Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Sat, 21 Sep 2019 11:31:03 +0300 Subject: [PATCH] Improved json load error messages --- .../main/resources/assets/plan/web/js/xmlhttprequests.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Plan/common/src/main/resources/assets/plan/web/js/xmlhttprequests.js b/Plan/common/src/main/resources/assets/plan/web/js/xmlhttprequests.js index 4fa7d3726..12537a730 100644 --- a/Plan/common/src/main/resources/assets/plan/web/js/xmlhttprequests.js +++ b/Plan/common/src/main/resources/assets/plan/web/js/xmlhttprequests.js @@ -15,20 +15,20 @@ function jsonRequest(address, callback) { callback(json, null) }, 0); } else if (this.status === 404 || this.status === 403 || this.status === 500) { - callback(null, this.status) + callback(null, "HTTP " + this.status + " (See " + address + ")") } else if (this.status === 400) { - callback(null, this.responseText) + callback(null, this.responseText + " (See " + address + ")") } else if (this.status === 0) { callback(null, "Request was blocked. (Adblocker maybe?)") } } catch (e) { - callback(null, e.message) + callback(null, e.message + " (See " + address + ")") } } }; xhttp.timeout = 20000; xhttp.ontimeout = function () { - callback(null, "Timed out after 20 seconds.") + callback(null, "Timed out after 20 seconds. (" + address + ")") }; xhttp.open("GET", address, true); xhttp.send();