Skip to content

Commit d61f34e

Browse files
fix: CG-10581 handle 404 github exception get_contents (#181)
1 parent a7ddbd8 commit d61f34e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/codegen/git/clients/git_repo_client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ def get_contents(self, file_path: str, ref: str | None = None) -> str | None:
8282
except UnknownObjectException:
8383
logger.info(f"File: {file_path} not found in ref: {ref}")
8484
return None
85+
except GithubException as e:
86+
if e.status == 404:
87+
logger.info(f"File: {file_path} not found in ref: {ref}")
88+
return None
89+
raise
8590

8691
def get_last_modified_date_of_path(self, path: str) -> datetime:
8792
"""Uses the GitHub API to return the last modified date of a given directory or file.

0 commit comments

Comments
 (0)