Skip to content

Commit

Permalink
try this
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Brain <andrewbrain2019@gmail.com>
  • Loading branch information
ABrain7710 committed Jul 23, 2024
1 parent 0b40bbb commit 4529a91
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions augur/tasks/github/util/github_graphql_data_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 4529a91

Please sign in to comment.