Skip to content

Commit a8286db

Browse files
authored
Merge pull request #106 from aliceinwire/results_fixes
results: Throw error if no data is found
2 parents aee25af + 01922cd commit a8286db

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

kcidev/subcommands/results.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,14 @@ def dashboard_api_fetch(endpoint, params):
2727
except:
2828
click.secho(f"Failed to fetch from {DASHBOARD_API}.")
2929
raise click.Abort()
30+
data = r.json()
3031

31-
return r.json()
32+
# check for errors in json data
33+
if "error" in data:
34+
kci_msg("json error: " + str(data["error"]))
35+
raise click.Abort()
36+
37+
return data
3238

3339

3440
def dashboard_fetch_summary(origin, giturl, branch, commit):

0 commit comments

Comments
 (0)