gitlab.lister: Break asap when problem exists during fetch info

Prior to this, when wrong url injection happens, no information is
fetched because we have bad input in the first place (404, 400).  This
makes the debugging session quite hard.
This commit is contained in:
Antoine R. Dumont (@ardumont) 2018-10-05 16:05:37 +02:00
parent ae514a84c4
commit 8f5b10b3a3
No known key found for this signature in database
GPG key ID: 52E2E9840D10C3B8

View file

@ -110,6 +110,9 @@ class GitLabLister(PageByPageHttpLister):
"""
response = self.transport_head(identifier=1)
if not response.ok:
raise ValueError(
'Problem during information fetch: %s' % response.status_code)
h = response.headers
return (self._get_int(h, 'x-total'),
self._get_int(h, 'x-total-pages'),