- +1 minor fix

This commit is contained in:
Dmytro Bogovych 2023-08-22 15:28:11 +03:00
parent 4bf2282f18
commit d8ebb909cb
1 changed files with 5 additions and 1 deletions

View File

@ -78,7 +78,11 @@ class QualtestBackend:
r = requests.post(url=url, json=report, timeout=utils.NETWORK_TIMEOUT)
utils.log_verbose(f"Upload report finished. Response (probe ID): {r.content}")
if r.status_code != 200:
raise RuntimeError(f'Server returned code {r.status_code}')
if r.status_code == 500 and 'Duplicate entry' in r.content().decode():
# Suppose it success
result = (report['id'], True)
else:
raise RuntimeError(f'Server returned code {r.status_code}')
result = (r.content.decode().strip('" '), True)
except Exception as e: