Fixed uncaught exceptions in Promise.

master
Rafael Cruz 5 years ago
parent 92521d6276
commit 3f1847c05f
  1. 4
      src/common/workerUtils.js

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

Loading…
Cancel
Save