_downloadablefilesource: handle ValueError-s
Description
Avoid unhandled exceptions like the following:
Traceback (most recent call last):
...
File "/src/buildstream/buildstream/plugins/sources/_downloadablefilesource.py", line 108, in _ensure_mirror
request = urllib.request.Request(self.url)
File "/usr/lib/python3.6/urllib/request.py", line 329, in __init__
self.full_url = url
File "/usr/lib/python3.6/urllib/request.py", line 355, in full_url
self._parse()
File "/usr/lib/python3.6/urllib/request.py", line 384, in _parse
raise ValueError("unknown url type: %r" % self.full_url)
ValueError: unknown url type: 'https//github.com/winlibs/icu4c.tar'
Explicitly handle ValueErrors, so that we report this condition in the usual way:
[00:00:00] FAILURE element.bst: tar source at
element.bst [line 10 column 2]: Error mirroring
https//github.com/winlibs/icu4c.tar: unknown url type:
'https//github.com/winlibs/icu4c.tar'
Changes proposed in this merge request:
- Handle ValueError-s
This merge request, when approved, will close: #452 (closed)
Edited by Angelos Evripiotis