Add error handling for advancedJsonDownload

This commit is contained in:
Pieter Vander Vennet 2022-12-16 01:02:23 +01:00
parent 293e03be46
commit 0074e39934

View file

@ -147,6 +147,9 @@ export default class Wikipedia {
},
]
}
if(result["error"]){
throw "Could not download: "+JSON.stringify(result)
}
const el = document.createElement("html")
el.innerHTML = result["content"].replace(/href="\//g, 'href="' + this.backend + "/")
const searchResults = el.getElementsByClassName("mw-search-results")