diff options
| author | leonoverweel <l.overweel@gmail.com> | 2017-04-01 21:40:06 +0200 |
|---|---|---|
| committer | leonoverweel <l.overweel@gmail.com> | 2017-04-01 21:40:06 +0200 |
| commit | 2162154a5152ea2acba40279befd58656846766a (patch) | |
| tree | 8558eaf73d83c85ab88d523458a95813227c8f58 /main.py | |
| parent | a06c408964dab6069b894c8fe11d09afdd7f9b81 (diff) | |
Make HTTP API calls robust to bad JSON
Diffstat (limited to 'main.py')
| -rw-r--r-- | main.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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({ |
