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

Loading…
Cancel
Save