summaryrefslogtreecommitdiff
path: root/player-android/lib/utils/error_mappers.dart
diff options
context:
space:
mode:
Diffstat (limited to 'player-android/lib/utils/error_mappers.dart')
-rw-r--r--player-android/lib/utils/error_mappers.dart13
1 files changed, 13 insertions, 0 deletions
diff --git a/player-android/lib/utils/error_mappers.dart b/player-android/lib/utils/error_mappers.dart
index 6ab9731..2d6f446 100644
--- a/player-android/lib/utils/error_mappers.dart
+++ b/player-android/lib/utils/error_mappers.dart
@@ -145,6 +145,19 @@ String podcastListErrorMessage(Object error) {
return 'Unexpected error. Please try again.';
}
+/// Maps any thrown object from [PlayerApiClient.listInProgress] to a UI string.
+///
+/// Delegates to [dioConnectionErrorMessage] for [DioException]; returns a
+/// generic fallback for all other exception types. Kept as a separate function
+/// (Open-Closed) so it can evolve independently — for example, adding a 401
+/// message if session refresh is needed in a future iteration.
+String continueWatchingErrorMessage(Object error) {
+ if (error is DioException) {
+ return dioConnectionErrorMessage(error);
+ }
+ return 'Unexpected error. Please try again.';
+}
+
/// Maps any thrown object from [PlayerApiClient.subscribePodcast] to a UI string.
///
/// Adds human-readable messages for the common failure modes: