diff options
author | Harald Welte <laforge@osmocom.org> | 2021-11-03 12:14:14 +0100 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2021-11-03 12:34:24 +0100 |
commit | 7a401a24bbf399d10c39dfb689164918dccc2b4f (patch) | |
tree | b83194f3c551d90a78b750c42bfe2d7b391af0d5 /contrib | |
parent | c8387dc03126302414079c3906a5b58845a19f13 (diff) |
sim-rest-client: Errors are plain text, not JSON
don't try to decode JSON where there is none.
Change-Id: Iafa5d1fc20b2b9ea8d9c828fc3c7e8490d0c3693
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/sim-rest-client.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/sim-rest-client.py b/contrib/sim-rest-client.py index 8f74adc..512765b 100755 --- a/contrib/sim-rest-client.py +++ b/contrib/sim-rest-client.py @@ -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: |