From ca7fd257bd98a355a8202f3ae5986bf8a6e76b8d Mon Sep 17 00:00:00 2001 From: Ethan Marshall Date: Sun, 28 Jan 2024 22:00:21 +0000 Subject: [PATCH] Fix broken error control path --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 7fa792e..3594153 100644 --- a/index.js +++ b/index.js @@ -26,7 +26,7 @@ function onready() // Returns the names from the API - as many as are configured. function get_names(onget) { - const error_response = ["Errar", "Prablem"]; + const error_response = Array(15).fill(["Errar", "Prablem"]).flat(); const uri = "/api"; let req = new XMLHttpRequest(); @@ -34,6 +34,7 @@ function get_names(onget) if (this.readyState == 4) { if (this.status != 200) { onget(error_response); + return; } try {