gracefully handle failure in freespace api call

This commit is contained in:
Neeraj Gupta 2022-06-09 17:04:25 +05:30
parent 7feec5e07e
commit bbd24581ad
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1

View file

@ -104,7 +104,15 @@ class BackupSectionWidgetState extends State<BackupSectionWidget> {
onTap: () async {
final dialog = createProgressDialog(context, "calculating...");
await dialog.show();
final status = await SyncService.instance.getBackupStatus();
BackupStatus status;
try {
status = await SyncService.instance.getBackupStatus();
} catch (e, s) {
await dialog.hide();
showGenericErrorDialog(context);
return;
}
await dialog.hide();
if (status.localIDs.isEmpty) {
showErrorDialog(context, "✨ all clear",