|
|
@ -144,15 +144,7 @@ res) => { |
|
|
|
res.progress({ workerId, status: 'loaded language traineddata', progress: 1 }); |
|
|
|
res.progress({ workerId, status: 'loaded language traineddata', progress: 1 }); |
|
|
|
res.resolve(langs); |
|
|
|
res.resolve(langs); |
|
|
|
} catch (err) { |
|
|
|
} catch (err) { |
|
|
|
if (isWebWorker && err instanceof DOMException) { |
|
|
|
res.reject(err.toString()); |
|
|
|
/* |
|
|
|
|
|
|
|
* 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()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|