summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngelos Evripiotis <angelos.evripiotis@gmail.com>2018-10-25 10:17:49 +0000
committerAngelos Evripiotis <angelos.evripiotis@gmail.com>2018-10-25 10:17:49 +0000
commit2d012a2100e31843d72a9f3e4fbf54638fecb09d (patch)
tree80ac9c35a8f596c04f535859cd5bfa8e1a8acf83
parent552f5fc69c8773726acc5a8c0997cd73341fa7f7 (diff)
parent276d21954ea45c1276581d2efafc97becfb1e0da (diff)
downloadbuildstream-2d012a2100e31843d72a9f3e4fbf54638fecb09d.tar.gz
Merge branch 'aevri/unknown-uri-452' into 'master'
_downloadablefilesource: handle ValueError-s Closes #452 See merge request BuildStream/buildstream!893
-rw-r--r--buildstream/plugins/sources/_downloadablefilesource.py4
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