mirror of
https://github.com/EttusResearch/uhd.git
synced 2026-10-25 17:36:10 +00:00
tools: changeset analyzer: Gracefully recover fail to get labels
This commit is contained in:
parent
84dad64c10
commit
5c897830c0
@ -251,7 +251,11 @@ def get_labels(api_endpoint, token):
|
|||||||
else:
|
else:
|
||||||
headers = {}
|
headers = {}
|
||||||
data = requests.get(api_endpoint, headers=headers).json()
|
data = requests.get(api_endpoint, headers=headers).json()
|
||||||
labels = [label["name"] for label in data]
|
try:
|
||||||
|
labels = [label["name"] for label in data]
|
||||||
|
except (KeyError, TypeError):
|
||||||
|
print("WARNING: Could not get labels from API. Return data: ", data)
|
||||||
|
return []
|
||||||
print("Labels:", ", ".join(labels))
|
print("Labels:", ", ".join(labels))
|
||||||
return labels
|
return labels
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user