Skip to content

Commit

Permalink
catch json exception explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasochem committed Nov 29, 2023
1 parent 82da7b3 commit ae6076c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/config-generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ae6076c

Please sign in to comment.