From 276d21954ea45c1276581d2efafc97becfb1e0da Mon Sep 17 00:00:00 2001 From: Angelos Evripiotis Date: Thu, 25 Oct 2018 10:17:49 +0000 Subject: _downloadablefilesource: handle ValueError-s --- buildstream/plugins/sources/_downloadablefilesource.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/buildstream/plugins/sources/_downloadablefilesource.py b/buildstream/plugins/sources/_downloadablefilesource.py index b4c7582fc..7d1fc07bf 100644 --- a/buildstream/plugins/sources/_downloadablefilesource.py +++ b/buildstream/plugins/sources/_downloadablefilesource.py @@ -152,7 +152,9 @@ class DownloadableFileSource(Source): raise SourceError("{}: Error mirroring {}: {}" .format(self, self.url, e), temporary=True) from e - except (urllib.error.URLError, urllib.error.ContentTooShortError, OSError) as e: + except (urllib.error.URLError, urllib.error.ContentTooShortError, OSError, ValueError) as e: + # Note that urllib.request.Request in the try block may throw a + # ValueError for unknown url types, so we handle it here. raise SourceError("{}: Error mirroring {}: {}" .format(self, self.url, e), temporary=True) from e -- cgit v1.2.1