Browse Source

Reject promise on init failure per #602 (#667)

dependabot/npm_and_yarn/json-schema-0.4.0
Balearica 2 years ago committed by GitHub
parent
commit
d8b29522c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/worker-script/index.js

5
src/worker-script/index.js

@ -185,7 +185,10 @@ const initialize = ({ @@ -185,7 +185,10 @@ const initialize = ({
api.End();
}
api = new TessModule.TessBaseAPI();
api.Init(null, langs, oem);
const status = api.Init(null, langs, oem);
if (status === -1) {
res.reject('initialization failed');
}
params = defaultParams;
setParameters({ payload: { params } });
res.progress({

Loading…
Cancel
Save