Name the data what it is

kivy_mainline_and_py3.8
Tyler Goodlet 2019-02-24 10:55:52 -05:00
parent c1a398d826
commit 295ccbbe64
1 changed files with 3 additions and 3 deletions

View File

@ -24,11 +24,11 @@ def resproc(
if not resp.status_code == 200: if not resp.status_code == 200:
raise BrokerError(resp.body) raise BrokerError(resp.body)
try: try:
data = resp.json() json = resp.json()
except json.decoder.JSONDecodeError: except json.decoder.JSONDecodeError:
log.exception(f"Failed to process {resp}:\n{resp.text}") log.exception(f"Failed to process {resp}:\n{resp.text}")
raise BrokerError(resp.text) raise BrokerError(resp.text)
else: else:
log.trace(f"Received json contents:\n{colorize_json(data)}") log.trace(f"Received json contents:\n{colorize_json(json)}")
return data if return_json else resp return json if return_json else resp