Skip to content

Commit

Permalink
catch JSONDecodeError
Browse files Browse the repository at this point in the history
  • Loading branch information
Przemyslaw Susko committed Oct 31, 2023
1 parent 1e0c935 commit 9ac5919
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ def url_matches_endpoint(url, endpoint):
output = discovery.stdout.readline()
if not output:
return None
services_json = json.loads(output)
try:
services_json = json.loads(output)
for service in services_json["service"]:
if url_matches_endpoint(url, service["endpoint"]):
return service
except KeyError:
except (json.decoder.JSONDecodeError, KeyError):
return None
return None

Expand Down

0 comments on commit 9ac5919

Please sign in to comment.