Skip to content

Commit

Permalink
Better GitLab error message (ImranR98#1106)
Browse files Browse the repository at this point in the history
  • Loading branch information
Imran Remtulla committed Dec 8, 2023
1 parent bf34c1b commit 9c95129
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/app_sources/gitlab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,15 @@ class GitLab extends AppSource {
});
}
if (apkDetailsList.isEmpty) {
throw NoReleasesError();
throw NoReleasesError(note: tr('gitlabSourceNote'));
}
if (fallbackToOlderReleases) {
if (additionalSettings['trackOnly'] != true) {
apkDetailsList =
apkDetailsList.where((e) => e.apkUrls.isNotEmpty).toList();
}
if (apkDetailsList.isEmpty) {
throw NoReleasesError();
throw NoReleasesError(note: tr('gitlabSourceNote'));
}
}
return apkDetailsList.first;
Expand Down
4 changes: 3 additions & 1 deletion lib/custom_errors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ class CredsNeededError extends ObtainiumError {
}

class NoReleasesError extends ObtainiumError {
NoReleasesError() : super(tr('noReleaseFound'));
NoReleasesError({String? note})
: super(
'${tr('noReleaseFound')}${note?.isNotEmpty == true ? '\n\n$note' : ''}');
}

class NoAPKError extends ObtainiumError {
Expand Down

0 comments on commit 9c95129

Please sign in to comment.