Skip to content

Commit d8b2952

Browse files
authored
Reject promise on init failure per #602 (#667)
1 parent dd6c40b commit d8b2952

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/worker-script/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,10 @@ const initialize = ({
185185
api.End();
186186
}
187187
api = new TessModule.TessBaseAPI();
188-
api.Init(null, langs, oem);
188+
const status = api.Init(null, langs, oem);
189+
if (status === -1) {
190+
res.reject('initialization failed');
191+
}
189192
params = defaultParams;
190193
setParameters({ payload: { params } });
191194
res.progress({

0 commit comments

Comments
 (0)