Fix broken error control path

This commit is contained in:
Ethan Marshall 2024-01-28 22:00:21 +00:00
parent 652cb26f57
commit ca7fd257bd
Signed by: ejv2
GPG key ID: EC2FAEF4DB8968D8

View file

@ -26,7 +26,7 @@ function onready()
// Returns the names from the API - as many as are configured. // Returns the names from the API - as many as are configured.
function get_names(onget) function get_names(onget)
{ {
const error_response = ["Errar", "Prablem"]; const error_response = Array(15).fill(["Errar", "Prablem"]).flat();
const uri = "/api"; const uri = "/api";
let req = new XMLHttpRequest(); let req = new XMLHttpRequest();
@ -34,6 +34,7 @@ function get_names(onget)
if (this.readyState == 4) { if (this.readyState == 4) {
if (this.status != 200) { if (this.status != 200) {
onget(error_response); onget(error_response);
return;
} }
try { try {