Skip to content

Commit

Permalink
fix: improve error reporting for web platform
Browse files Browse the repository at this point in the history
  • Loading branch information
ilfa committed Jan 19, 2024
1 parent 712f50b commit df3739c
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions lib/fpjs_pro_plugin_web.dart
Expand Up @@ -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());
}
}
}

Expand All @@ -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());
}
}
}

Expand Down Expand Up @@ -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());
}
}
}
}
Expand Down

0 comments on commit df3739c

Please sign in to comment.