Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use tryParse in PurchasesErrorHelper to avoid FormatException #1160

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kbot
Copy link

@kbot kbot commented Sep 10, 2024

In some cases using PurchasesErrorHelper in a catch block will result in an uncaught FormatException when code is not a valid Int. This causes additional boilerplate in client applications.

Example error observed in production:

Non-fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: FormatException: Invalid radix-10 number (at character 1)
error
^

       at int.parse(dart:core)
       at PurchasesErrorHelper.getErrorCode(errors.dart:146)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants