From 4529a912ca1edfab4f855a02b6c766525e4882d8 Mon Sep 17 00:00:00 2001 From: Andrew Brain Date: Mon, 22 Jul 2024 19:46:16 -0500 Subject: [PATCH] try this Signed-off-by: Andrew Brain --- augur/tasks/github/util/github_graphql_data_access.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/augur/tasks/github/util/github_graphql_data_access.py b/augur/tasks/github/util/github_graphql_data_access.py index b7586496a..3af16366d 100644 --- a/augur/tasks/github/util/github_graphql_data_access.py +++ b/augur/tasks/github/util/github_graphql_data_access.py @@ -44,6 +44,8 @@ def paginate_resource(self, query, variables, result_keys): result_json = self.make_request_with_retries(query, params).json() data = self.__extract_data_section(result_keys, result_json) + if data is None: + raise Exception(f"Error: data section of response is None. Query: {query}. Response: {result_json}") if self.__get_total_count(data) == 0: return @@ -56,6 +58,8 @@ def paginate_resource(self, query, variables, result_keys): result_json = self.make_request_with_retries(query, params).json() data = self.__extract_data_section(result_keys, result_json) + if data is None: + raise Exception(f"Error: data section of response is None. Query: {query}. Response: {result_json}") yield from self.__extract_raw_data_into_list(data) @@ -157,8 +161,6 @@ def __extract_data_section(self, keys, json_response): core = core[value] - if core is None: - raise Exception(f"Error: data section of response is None. Response: {json_response}") return core