Browse Source

Merge pull request #290 from iscoolapp/master

Fixed uncaught exceptions in Promise.

Merged, thanks for your contribution 👍
pull/307/head
jeromewu 6 years ago committed by GitHub
parent
commit
2a2d05150d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/common/workerUtils.js

4
src/common/workerUtils.js

@ -205,6 +205,7 @@ const handleRecognize = ({ @@ -205,6 +205,7 @@ const handleRecognize = ({
}
})
.then(() => {
try {
const progressUpdate = (progress) => {
res.progress({ status: 'initializing api', progress });
};
@ -223,6 +224,9 @@ const handleRecognize = ({ @@ -223,6 +224,9 @@ const handleRecognize = ({
api.End();
TessModule._free(ptr);
res.resolve({ files, ...result });
} catch (err) {
res.reject({ err: err });
}
})
))
);

Loading…
Cancel
Save