From ac151b709d06398b0de9d72b8492a6aa468e739a Mon Sep 17 00:00:00 2001 From: garyelephant Date: Fri, 6 Jul 2018 11:46:19 +0800 Subject: [PATCH] fixed ValueError: No JSON object could be decoded in guardian spark checker --- spark_checker/streaming_utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spark_checker/streaming_utils.py b/spark_checker/streaming_utils.py index b9e69ce..417e281 100644 --- a/spark_checker/streaming_utils.py +++ b/spark_checker/streaming_utils.py @@ -34,7 +34,11 @@ def streaming_batch_stats(master_url, application_id, status=None, timeout=20): if resp.status_code != 200: continue - stats_json = resp.json() + try: + stats_json = resp.json() + except ValueError as e: + stats_json = None + break if stats_json is None: