Fix broken error control path
This commit is contained in:
parent
652cb26f57
commit
ca7fd257bd
1 changed files with 2 additions and 1 deletions
3
index.js
3
index.js
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue