From 13172eaaf5886109255d563ba9f2cec1f0e438f3 Mon Sep 17 00:00:00 2001 From: Ben Hills Date: Wed, 18 Sep 2024 16:08:25 +0100 Subject: [PATCH] Update dio dependency to 5.7.0. --- CHANGELOG.md | 5 +++++ lib/src/model/podcast.dart | 10 ++++++++++ pubspec.yaml | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd6ed67..fa0fba1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.7.3 + +- Additional exception handler for certificate issues which then throws PodcastCertificateException. +- Updated Dio dependency to 5.7.0. + ## 0.7.2 - Added retry to Apple charts API call to handle intermittent 503 errors. diff --git a/lib/src/model/podcast.dart b/lib/src/model/podcast.dart index 1956746..b7b64da 100644 --- a/lib/src/model/podcast.dart +++ b/lib/src/model/podcast.dart @@ -128,6 +128,16 @@ class Podcast { case DioExceptionType.cancel: throw PodcastCancelledException(e.message ?? ''); case DioExceptionType.unknown: + + /// We may be able to determine the underlying error + if (e.error is HandshakeException) { + throw PodcastCertificateException(e.message ?? ''); + } + + if (e.error is CertificateException) { + throw PodcastCertificateException(e.message ?? ''); + } + throw PodcastUnknownException(e.message ?? ''); } } diff --git a/pubspec.yaml b/pubspec.yaml index 8a7913a..3e2674c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: podcast_search description: A library for searching for podcasts and parsing podcast RSS feeds. Supports iTunes and PodcastIndex directories, and newer features such as chapters and transcripts. -version: 0.7.2 +version: 0.7.3 homepage: https://github.com/amugofjava/podcast_search environment: