Browse Source

Made all errors in loadLanguage lead to promise rejection per #414 (#669)

pull/671/head
Balearica 2 years ago committed by GitHub
parent
commit
1b87e30ae3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      src/worker-script/index.js

10
src/worker-script/index.js

@ -144,15 +144,7 @@ res) => { @@ -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());
}
};

Loading…
Cancel
Save