- minor logging fixes & improvements

This commit is contained in:
Dmytro Bogovych 2023-09-05 16:51:43 +03:00
parent dc5a22bc0a
commit 200b1f5cff
1 changed files with 3 additions and 2 deletions

View File

@ -224,15 +224,16 @@ class QualtestBackend:
# Get response from server # Get response from server
response = requests.get(url, timeout=(utils.NETWORK_TIMEOUT, 5)) response = requests.get(url, timeout=(utils.NETWORK_TIMEOUT, 5))
if response.status_code != 200: if response.status_code != 200:
utils.log_error("Failed to get audio. Error code: %s" % response.status_code) utils.log_error(f' Failed to get audio. Error code: {response.status_code}, msg: {response.content}')
return False return False
with open (output_path, 'wb') as f: with open (output_path, 'wb') as f:
f.write(response.content) f.write(response.content)
utils.log(' Done.')
return True return True
except Exception as err: except Exception as err:
utils.log_error("Exception when fetching list: {0}".format(err)) utils.log_error(f' Exception when fetching audio: {str(err)}')
return False return False