From df3739c147a9e1e1f9e98604848a50754326c282 Mon Sep 17 00:00:00 2001 From: Ilya Taratukhin Date: Fri, 19 Jan 2024 13:01:32 +0100 Subject: [PATCH] fix: improve error reporting for web platform --- lib/fpjs_pro_plugin_web.dart | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/fpjs_pro_plugin_web.dart b/lib/fpjs_pro_plugin_web.dart index f1042dd..06bb494 100644 --- a/lib/fpjs_pro_plugin_web.dart +++ b/lib/fpjs_pro_plugin_web.dart @@ -79,7 +79,11 @@ class FpjsProPluginWeb { _isExtendedResult = call.arguments['extendedResponseFormat']; _isInitialized = true; } catch (e) { - throw unwrapWebError(e as WebException); + if (e is WebException) { + throw unwrapWebError(e); + } else { + throw UnknownError(e.toString()); + } } } @@ -99,7 +103,11 @@ class FpjsProPluginWeb { fp.get(FingerprintJSGetOptions(linkedId: linkedId, tag: tags))); return result.visitorId; } catch (e) { - throw unwrapWebError(e as WebException); + if (e is WebException) { + throw unwrapWebError(e); + } else { + throw UnknownError(e.toString()); + } } } @@ -136,7 +144,11 @@ class FpjsProPluginWeb { serializedResult ]; } catch (e) { - throw unwrapWebError(e as WebException); + if (e is WebException) { + throw unwrapWebError(e); + } else { + throw UnknownError(e.toString()); + } } } }