purchases-flutter
purchases-flutter copied to clipboard
use tryParse in PurchasesErrorHelper to avoid FormatException
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)