From 474d539e3138b5560b5238272d3e6915e2ff5978 Mon Sep 17 00:00:00 2001 From: Ryan Bobrowski Date: Thu, 22 Aug 2024 14:56:14 +0000 Subject: [PATCH] fix-display-appropriate-output-when-project-not-in-dev-mode --- henry/modules/fetcher.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/henry/modules/fetcher.py b/henry/modules/fetcher.py index 700004d..6d6a5ec 100644 --- a/henry/modules/fetcher.py +++ b/henry/modules/fetcher.py @@ -320,7 +320,14 @@ 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) @@ -427,3 +434,4 @@ class Input(NamedTuple): quiet: bool = False save: Optional[bool] = False timeout: Optional[int] = 120 +