@@ -57,7 +57,10 @@ def get_diff_from_url(self, pr_url: PRUrl) -> PRDiff:
5757 try :
5858 parsed_diff = parse_diff_patch (metadata = metadata , diff_text = file .patch or "" )
5959 except GitDiffParseError :
60- logger .exception ("Failed to parse diff patch for file %s, will skip it" , file .filename )
60+ logger .exception (
61+ "Failed to parse diff patch for file %s, will skip it" ,
62+ file .filename ,
63+ )
6164 continue
6265 parsed .append (parsed_diff )
6366
@@ -119,7 +122,11 @@ def get_issue_content(self, issues_url: HttpUrl, issue_id: str) -> IssueContent
119122 repo = _get_repo_from_issues_url (self .client , issues_url )
120123 issue = repo .get_issue (int (issue_id ))
121124 except (github .GithubException , ValueError ) as err :
122- logger .error ("Failed to retrieve the issue content from GitHub for issue %s: %s" , issue_id , err )
125+ logger .warning (
126+ "Failed to retrieve the issue content from GitHub for issue %s: %s" ,
127+ issue_id ,
128+ err ,
129+ )
123130 return None
124131
125132 return IssueContent (
@@ -146,7 +153,7 @@ def get_file_contents(self, pr_url: PRUrl, file_path: str, branch_name: ContextB
146153 try :
147154 file_contents = repo .get_contents (file_path , ref = pr .head .ref if branch_name == "source" else pr .base .ref )
148155 except github .GithubException as err :
149- logger .error (
156+ logger .warning (
150157 "Failed to retrieve file %s from GitHub branch %s, error: %s" ,
151158 file_path ,
152159 branch_name ,
@@ -168,9 +175,9 @@ def get_file_contents(self, pr_url: PRUrl, file_path: str, branch_name: ContextB
168175 )
169176 return None
170177 decoded_chunk_content = decoded_bytes .decode ("utf-8" )
171- except (binascii .Error , UnicodeDecodeError ):
172- logger .error (
173- "Failed to decode file %s from GitHub sha: %s, ignoring..." ,
178+ except (binascii .Error , UnicodeDecodeError , AssertionError ):
179+ logger .warning (
180+ "Failed to get decoded content for file %s from branch %s, ignoring..." ,
174181 file_path ,
175182 branch_name ,
176183 )
0 commit comments