diff --git a/scripts/python/get_author_origin.py b/scripts/python/get_author_origin.py index 2f8eb6bd7..0ff857386 100644 --- a/scripts/python/get_author_origin.py +++ b/scripts/python/get_author_origin.py @@ -3,10 +3,14 @@ membrane_team = json.load(sys.stdin) pr_author = sys.argv[1] -for person in membrane_team: - if person["login"] == pr_author: - print("MEMBRANE") - sys.exit(0) - -print("COMMUNITY") +try: + for person in membrane_team: + if person["login"] == pr_author: + print("MEMBRANE") + sys.exit(0) + print("COMMUNITY") +except: + print("An exception occurred, provided JSON:") + print(membrane_team) + print("provided PR_AUTHOR:", pr_author) \ No newline at end of file diff --git a/scripts/python/get_ticket_id.py b/scripts/python/get_ticket_id.py index 9ac65b1de..d0eb92104 100644 --- a/scripts/python/get_ticket_id.py +++ b/scripts/python/get_ticket_id.py @@ -1,6 +1,13 @@ import sys, json; -project_items = json.load(sys.stdin)["items"] +full_json = json.load(sys.stdin) pr_url = sys.argv[1] -[id] = [item["id"] for item in project_items if ("url" in item["content"] and item["content"]["url"] == pr_url)] -print(id) + +try: + project_items = full_json["items"] + [id] = [item["id"] for item in project_items if ("url" in item["content"] and item["content"]["url"] == pr_url)] + print(id) +except: + print("An exception occurred, provided JSON:") + print(full_json) + print("provided PR_URL:", pr_url) \ No newline at end of file