@authme/engine 2.2.1-rc.5 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -292,6 +292,9 @@
292
292
  positions[3][1]
293
293
  );
294
294
  },
295
+ getFinalResult() {
296
+ return this.instance.getFinalResult();
297
+ },
295
298
  };
296
299
 
297
300
  // Card OCR
@@ -506,18 +509,32 @@
506
509
  addEventListener(
507
510
  'message',
508
511
  async function onWorkerMessage({ data }) {
509
- const { module, command, id, value } = data;
510
- const fn = self[module][command];
511
- if (fn) {
512
- // console.log(`call ${module}.${command} :`, value);
513
- const result = await fn.call(self[module], value);
514
- // console.log(`worker return value for ${command}:`, result);
512
+ try {
513
+ const { module, command, id, value } = data;
514
+ const fn = self[module][command];
515
+ if (fn) {
516
+ // console.log(`call ${module}.${command} :`, value);
517
+ const result = await fn.call(self[module], value);
518
+ // console.log(`worker return value for ${command}:`, result);
519
+ postMessage({
520
+ module,
521
+ command,
522
+ id,
523
+ value: result,
524
+ });
525
+ }
526
+ } catch (error) {
527
+ const { module, command, id } = data;
515
528
  postMessage({
516
529
  module,
517
530
  command,
518
531
  id,
519
- value: result,
532
+ value: {
533
+ error: true,
534
+ cause: error,
535
+ },
520
536
  });
537
+ throw error;
521
538
  }
522
539
  }.bind(self)
523
540
  );