[autotest] Handle json file parsing error

perf_dashboard_shadow_config.json is deployed by puppet and there is no cq to
validate that change. Handle the ValueError in case the json file is
malformated.

BUG=chromium:581382
TEST=None

Change-Id: I91fcfd51b73c5e9654f412ff3c0f630371bd5b30
Reviewed-on: https://chromium-review.googlesource.com/324101
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Kevin Cheng <kevcheng@chromium.org>
diff --git a/tko/perf_upload/perf_uploader.py b/tko/perf_upload/perf_uploader.py
index c6bc9dc..4bce337 100644
--- a/tko/perf_upload/perf_uploader.py
+++ b/tko/perf_upload/perf_uploader.py
@@ -375,8 +375,12 @@
     hardware_hostname = test.machine
     variant_name = test.attributes.get(constants.VARIANT_KEY, None)
     config_data = _parse_config_file(_PRESENTATION_CONFIG_FILE)
-    shadow_config_data = _parse_config_file(_PRESENTATION_SHADOW_CONFIG_FILE)
-    config_data.update(shadow_config_data)
+    try:
+        shadow_config_data = _parse_config_file(_PRESENTATION_SHADOW_CONFIG_FILE)
+        config_data.update(shadow_config_data)
+    except ValueError as e:
+        tko_utils.dprint('Failed to parse config file %s: %s.' %
+                         (_PRESENTATION_SHADOW_CONFIG_FILE, e))
     try:
         cros_version, chrome_version = _get_version_numbers(test.attributes)
         presentation_info = _gather_presentation_info(config_data, test_name)