From 0074e39934fc9bd7b8cd8a92247030a103423bc5 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 16 Dec 2022 01:02:23 +0100 Subject: [PATCH] Add error handling for advancedJsonDownload --- Logic/Web/Wikipedia.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Logic/Web/Wikipedia.ts b/Logic/Web/Wikipedia.ts index 6be26931ce..5ee6227df3 100644 --- a/Logic/Web/Wikipedia.ts +++ b/Logic/Web/Wikipedia.ts @@ -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")