Merge "Remove redundant statement and refactor"
This commit is contained in:
@@ -238,14 +238,12 @@ class HTTPClient(object):
|
|||||||
**kwargs)
|
**kwargs)
|
||||||
self.http_log_resp(resp)
|
self.http_log_resp(resp)
|
||||||
|
|
||||||
|
body = None
|
||||||
if resp.text:
|
if resp.text:
|
||||||
try:
|
try:
|
||||||
body = json.loads(resp.text)
|
body = json.loads(resp.text)
|
||||||
except ValueError:
|
except ValueError as e:
|
||||||
pass
|
self._logger.debug("Load http response text error: %s", e)
|
||||||
body = None
|
|
||||||
else:
|
|
||||||
body = None
|
|
||||||
|
|
||||||
if resp.status_code >= 400:
|
if resp.status_code >= 400:
|
||||||
raise exceptions.from_response(resp, body)
|
raise exceptions.from_response(resp, body)
|
||||||
|
Reference in New Issue
Block a user