fix: Handle exceptions on APIs in a more legible way

This commit is contained in:
Alberto Ponces
2022-09-12 09:18:03 +01:00
parent e22b643375
commit 7e8ccdff43
2 changed files with 5 additions and 8 deletions

View File

@@ -38,7 +38,7 @@ class RevancedAPI {
contributors[name] = repo['contributors'];
}
} on Exception {
// ignore
return {};
}
return contributors;
}
@@ -49,9 +49,8 @@ class RevancedAPI {
List<dynamic> patches = response.data;
return patches.map((patch) => Patch.fromJson(patch)).toList();
} on Exception {
// ignore
return List.empty();
}
return List.empty();
}
Future<Map<String, dynamic>?> _getLatestRelease(