mirror of https://gitee.com/openkylin/qemu.git
scripts/ci/gitlab-pipeline-status: give more information on failures
When an HTTP GET request fails, it's useful to go beyond the "not successful" message, and show the code returned by the server. Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Message-Id: <20210222193240.921250-3-crosa@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
2faf56bd95
commit
861d1d509b
|
@ -56,7 +56,9 @@ def get_json_http_response(url):
|
|||
connection.request('GET', url=url)
|
||||
response = connection.getresponse()
|
||||
if response.code != http.HTTPStatus.OK:
|
||||
raise CommunicationFailure("Failed to receive a successful response")
|
||||
msg = "Received unsuccessful response: %s (%s)" % (response.code,
|
||||
response.reason)
|
||||
raise CommunicationFailure(msg)
|
||||
return json.loads(response.read())
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue