sim-rest-client: Errors are plain text, not JSON

don't try to decode JSON where there is none.

Change-Id: Iafa5d1fc20b2b9ea8d9c828fc3c7e8490d0c3693
This commit is contained in:
Harald Welte 2021-11-03 12:14:14 +01:00
parent c8387dc031
commit 7a401a24bb
1 changed files with 3 additions and 0 deletions

View File

@ -128,6 +128,9 @@ def main(argv):
req_json = {'rand': rand.hex(), 'autn': t['autn'].hex()}
print("-> %s" % req_json)
resp = rest_post('/slot/%u' % args.slot_nr, req_json)
if not resp.ok:
print("<- ERROR %u: %s" % (resp.status_code, resp.text))
break
resp_json = resp.json()
print("<- %s" % resp_json)
if 'synchronisation_failure' in resp_json: