mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
fix: Handle exceptions on APIs in a more legible way
This commit is contained in:
parent
e22b643375
commit
7e8ccdff43
@ -42,10 +42,9 @@ class GithubAPI {
|
||||
);
|
||||
return response.data;
|
||||
} on Exception {
|
||||
// ignore
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Future<List<String>> getCommits(
|
||||
String packageName,
|
||||
@ -70,10 +69,9 @@ class GithubAPI {
|
||||
(commit['commit']['message'] as String).split('\n')[0])
|
||||
.toList();
|
||||
} on Exception {
|
||||
// ignore
|
||||
}
|
||||
return List.empty();
|
||||
}
|
||||
}
|
||||
|
||||
Future<File?> getLatestReleaseFile(String extension, String repoName) async {
|
||||
try {
|
||||
@ -104,7 +102,7 @@ class GithubAPI {
|
||||
patches = list.map((patch) => Patch.fromJson(patch)).toList();
|
||||
}
|
||||
} on Exception {
|
||||
// ignore
|
||||
return List.empty();
|
||||
}
|
||||
return patches;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ class RevancedAPI {
|
||||
contributors[name] = repo['contributors'];
|
||||
}
|
||||
} on Exception {
|
||||
// ignore
|
||||
return {};
|
||||
}
|
||||
return contributors;
|
||||
}
|
||||
@ -49,10 +49,9 @@ class RevancedAPI {
|
||||
List<dynamic> patches = response.data;
|
||||
return patches.map((patch) => Patch.fromJson(patch)).toList();
|
||||
} on Exception {
|
||||
// ignore
|
||||
}
|
||||
return List.empty();
|
||||
}
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>?> _getLatestRelease(
|
||||
String extension,
|
||||
|
Loading…
Reference in New Issue
Block a user