Closed sveres closed 4 years ago
Hi @sveres,
You're correct. We've identified this problem and in the upcoming version this error is handled in a different way.
This code has been modified to use Promise.reject()
method, so the consumer of BlinkID SDK can catch all errors with Promise mechanism.
That is, when using this approach during integration, all errors can be handled:
BlinkIDSDK.loadWasmModule(loadSettings).then(
(sdk) => {
// SDK is ready
},
(error) => {
console.error("Failed to load SDK!", error);
}
);
sounds good @vjekoart , do you have an ETA for this mentioned release?
@sveres upcoming version should be released during this or next week
Hi @vjekoart , is there any update on this fix?
Hi @sveres ,
We've released BlinkID v5.8.1 which has fix for this problem. Please see changelog for complete list of changes, but keep in mind that version 5.8.1 is minor bugfix, while majority of changes is documented under 5.8.0 section.
Sorry for the delay, we had some unexpected technical challenges :)
https://github.com/BlinkID/blinkid-in-browser/blob/414d183e54f0853495c341b661b4feda43e4078c/src/MicroblinkSDK/worker/WorkerSDKBackend.ts#L496
I think If error is thrown directly in the constructor then its fine, but throwing the error in the onerror's callback will lead to losing the context and the promise will not get rejected. Or do I miss something?