From ae6076c4872c72e66b79aeea0ccd1250f5f8ae99 Mon Sep 17 00:00:00 2001 From: Nicolas Ochem Date: Tue, 28 Nov 2023 19:41:03 -0800 Subject: [PATCH] catch json exception explicitly --- utils/config-generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/config-generator.py b/utils/config-generator.py index b3a5b56ae..4d9fb2c1c 100755 --- a/utils/config-generator.py +++ b/utils/config-generator.py @@ -738,7 +738,7 @@ def create_node_snapshot_config_json(history_mode): response = requests.get(snapshot_source) response.raise_for_status() # Raises an HTTPError if the HTTP request returned an unsuccessful status code all_snapshots = response.json() - except (requests.exceptions.RequestException, ValueError): # Catches exceptions related to requests and invalid JSON + except (requests.exceptions.RequestException, requests.exceptions.JSONDecodeError): # Catches exceptions related to requests and invalid JSON print(f"Error: unable to retrieve snapshot metadata from {snapshot_source}") return else: