diff options
author | Angelos Evripiotis <angelos.evripiotis@gmail.com> | 2018-10-25 10:17:49 +0000 |
---|---|---|
committer | Angelos Evripiotis <angelos.evripiotis@gmail.com> | 2018-10-25 10:17:49 +0000 |
commit | 276d21954ea45c1276581d2efafc97becfb1e0da (patch) | |
tree | 80ac9c35a8f596c04f535859cd5bfa8e1a8acf83 | |
parent | 552f5fc69c8773726acc5a8c0997cd73341fa7f7 (diff) | |
download | buildstream-276d21954ea45c1276581d2efafc97becfb1e0da.tar.gz |
_downloadablefilesource: handle ValueError-s
-rw-r--r-- | buildstream/plugins/sources/_downloadablefilesource.py | 4 |
1 files changed, 3 insertions, 1 deletions
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 |