From 9c951293115e48d5c76492e81090ac347920c7ce Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Thu, 7 Dec 2023 21:55:35 -0500 Subject: [PATCH] Better GitLab error message (#1106) --- lib/app_sources/gitlab.dart | 4 ++-- lib/custom_errors.dart | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/app_sources/gitlab.dart b/lib/app_sources/gitlab.dart index 888d727..265b299 100644 --- a/lib/app_sources/gitlab.dart +++ b/lib/app_sources/gitlab.dart @@ -203,7 +203,7 @@ class GitLab extends AppSource { }); } if (apkDetailsList.isEmpty) { - throw NoReleasesError(); + throw NoReleasesError(note: tr('gitlabSourceNote')); } if (fallbackToOlderReleases) { if (additionalSettings['trackOnly'] != true) { @@ -211,7 +211,7 @@ class GitLab extends AppSource { apkDetailsList.where((e) => e.apkUrls.isNotEmpty).toList(); } if (apkDetailsList.isEmpty) { - throw NoReleasesError(); + throw NoReleasesError(note: tr('gitlabSourceNote')); } } return apkDetailsList.first; diff --git a/lib/custom_errors.dart b/lib/custom_errors.dart index eed8484..a648670 100644 --- a/lib/custom_errors.dart +++ b/lib/custom_errors.dart @@ -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 {