From 7a401a24bbf399d10c39dfb689164918dccc2b4f Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 3 Nov 2021 12:14:14 +0100 Subject: [PATCH] sim-rest-client: Errors are plain text, not JSON don't try to decode JSON where there is none. Change-Id: Iafa5d1fc20b2b9ea8d9c828fc3c7e8490d0c3693 --- contrib/sim-rest-client.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/sim-rest-client.py b/contrib/sim-rest-client.py index 8f74adcc..512765bd 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: