From 2162154a5152ea2acba40279befd58656846766a Mon Sep 17 00:00:00 2001 From: leonoverweel Date: Sat, 1 Apr 2017 21:40:06 +0200 Subject: Make HTTP API calls robust to bad JSON --- main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'main.py') diff --git a/main.py b/main.py index d49e4191..41799dae 100644 --- a/main.py +++ b/main.py @@ -116,7 +116,10 @@ def api_call(version, endpoint_path): except: pass - body_parameters = json.loads(request.get_data()) + try: + body_parameters = json.loads(request.get_data()) + except: + body_parameters = {} # Create and call request (req, response) = _process_message({ -- cgit v1.2.3