Skip to content

Commit 2b99d87

Browse files
committed
handle better
1 parent c025215 commit 2b99d87

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

codeflash/api/cfapi.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -349,14 +349,14 @@ def get_blocklisted_functions() -> dict[str, set[str]] | dict[str, Any]:
349349
if req.status_code >= 500:
350350
logger.error(f"Server error getting blocklisted functions: {req.status_code}")
351351
sentry_sdk.capture_message(f"Server error in verify-existing-optimizations: {req.status_code}")
352-
elif req.status_code == 401:
353-
logger.debug(f"Not authorized to check blocklisted functions for {owner}/{repo} PR #{pr_number}")
354-
elif req.status_code == 404:
355-
logger.debug(f"PR #{pr_number} not found for {owner}/{repo}")
356-
elif not req.ok:
357-
logger.warning(f"Unexpected response {req.status_code} from verify-existing-optimizations")
358-
352+
return {}
359353
if not req.ok:
354+
if req.status_code == 401:
355+
logger.debug(f"Not authorized to check blocklisted functions for {owner}/{repo} PR #{pr_number}")
356+
elif req.status_code == 404:
357+
logger.debug(f"PR #{pr_number} not found for {owner}/{repo}")
358+
else:
359+
logger.warning(f"Unexpected response {req.status_code} from verify-existing-optimizations")
360360
return {}
361361

362362
content: dict[str, list[str]] = req.json()

0 commit comments

Comments
 (0)