Skip to content

Commit

Permalink
Merge pull request #392 from C-Accel-CRIPT/improve-pagiantor-error
Browse files Browse the repository at this point in the history
improve paginator error message
  • Loading branch information
nh916 authored Oct 25, 2023
2 parents 661342b + 4360716 commit 67ec191
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cript/api/paginator.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ def fetch_page_from_api(self) -> List[dict]:
self.current_page_results = []
return self.current_page_results

# if API response is not 200 raise error for the user to debug
if api_response["code"] != 200:
raise APIError(api_error=str(response), http_method="GET", api_url=temp_api_endpoint)
raise APIError(api_error=str(response.json()), http_method="GET", api_url=temp_api_endpoint)

return self.current_page_results

0 comments on commit 67ec191

Please sign in to comment.