From b37a80a51f49e2412a038eaa71fb597c39c4a81f Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 15 Apr 2020 01:55:50 +0000 Subject: [PATCH] Don't miserably fail if can't fetch result from one CI source --- app/models/appci.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/appci.py b/app/models/appci.py index f123cff..463e785 100644 --- a/app/models/appci.py +++ b/app/models/appci.py @@ -131,7 +131,11 @@ class AppCI(): # Scrap jenkins for cibranch in cibranches: print("> Fetching current CI results for C.I. branch {}".format(cibranch.name)) - result_json = requests.get(cibranch.url).text + try: + result_json = requests.get(cibranch.url).text + except: + print("Failed to fetch %s" % cibranch.url) + continue cleaned_json = [ line for line in result_json.split("\n") if "test_name" in line ] cleaned_json = [ line.replace('"level": ?,', '"level": null,') for line in cleaned_json ] cleaned_json = "[" + ''.join(cleaned_json)[:-1] + "]"