From 1b87e30ae3f8b8c2bcac40dc8f017ec082fcb9f3 Mon Sep 17 00:00:00 2001 From: Balearica Date: Tue, 20 Sep 2022 17:41:29 -0700 Subject: [PATCH] Made all errors in loadLanguage lead to promise rejection per #414 (#669) --- src/worker-script/index.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/worker-script/index.js b/src/worker-script/index.js index 7e65930..e465e81 100644 --- a/src/worker-script/index.js +++ b/src/worker-script/index.js @@ -144,15 +144,7 @@ res) => { res.progress({ workerId, status: 'loaded language traineddata', progress: 1 }); res.resolve(langs); } catch (err) { - if (isWebWorker && err instanceof DOMException) { - /* - * For some reason google chrome throw DOMException in loadLang, - * while other browser is OK, for now we ignore this exception - * and hopefully to find the root cause one day. - */ - } else { - res.reject(err.toString()); - } + res.reject(err.toString()); } };