diff --git a/lib/main.dart b/lib/main.dart index 4bfada8..e6c4846 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -14,7 +14,7 @@ import 'package:dynamic_color/dynamic_color.dart'; import 'package:device_info_plus/device_info_plus.dart'; const String currentReleaseTag = - 'v0.5.8-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES + 'v0.5.9-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES const String bgUpdateCheckTaskName = 'bg-update-check'; diff --git a/lib/providers/apps_provider.dart b/lib/providers/apps_provider.dart index a416e7f..1433e58 100644 --- a/lib/providers/apps_provider.dart +++ b/lib/providers/apps_provider.dart @@ -325,6 +325,7 @@ class AppsProvider with ChangeNotifier { Future> checkUpdates({DateTime? ignoreAfter}) async { List updates = []; + Map> errors = {}; if (!gettingUpdates) { gettingUpdates = true; @@ -340,14 +341,31 @@ class AppsProvider with ChangeNotifier { DateTime.fromMicrosecondsSinceEpoch(0)) .compareTo(apps[b]!.app.lastUpdateCheck ?? DateTime.fromMicrosecondsSinceEpoch(0))); + for (int i = 0; i < appIds.length; i++) { - App? newApp = await getUpdate(appIds[i]); + App? newApp; + try { + newApp = await getUpdate(appIds[i]); + } catch (e) { + var tempIds = errors.remove(e.toString()); + tempIds ??= []; + tempIds.add(appIds[i]); + errors.putIfAbsent(e.toString(), () => tempIds!); + } if (newApp != null) { updates.add(newApp); } } gettingUpdates = false; } + if (errors.isNotEmpty) { + String finalError = ''; + for (var e in errors.keys) { + finalError += + '$e ${errors[e]!.map((e) => apps[e]!.app.name).toString()}. '; + } + throw finalError; + } return updates; } diff --git a/pubspec.yaml b/pubspec.yaml index 0d02e62..883f930 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 0.5.8+29 # When changing this, update the tag in main() accordingly +version: 0.5.9+30 # When changing this, update the tag in main() accordingly environment: sdk: '>=2.19.0-79.0.dev <3.0.0'