Skip to content

Commit

Permalink
fix: display appropriate output when project does not exist in develo…
Browse files Browse the repository at this point in the history
…pment mode (edge case)
  • Loading branch information
rbob86 committed Aug 22, 2024
1 parent 6138aca commit a7122ad
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion henry/modules/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,15 @@ def get_explore_join_stats(
def run_git_connection_tests(self, project_id: str):
"""Run all git connection tests for a given project."""
self.sdk.update_session(models.WriteApiSession(workspace_id="dev"))
supported_tests = self.sdk.all_git_connection_tests(project_id)

try:
supported_tests = self.sdk.all_git_connection_tests(project_id, transport_options={"headers": {"Accept": "application/json"}})
except error.SDKError as e:
if e.message == "The resource you're looking for could not be found":
return "Project not found in development mode"
else:
return "Error running git connection tests"

results = []
for test in supported_tests:
assert isinstance(test.id, str)
Expand Down

0 comments on commit a7122ad

Please sign in to comment.