Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit c59da64

Browse files
use existing error handling
1 parent aab3b8b commit c59da64

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

graphql_api/types/repository/repository.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -265,19 +265,12 @@ def resolve_repository_result_type(obj: Any, *_: Any) -> Optional[str]:
265265
def resolve_is_first_pull_request(
266266
repository: Repository, info: GraphQLResolveInfo
267267
) -> bool:
268-
try:
269-
# Get at most 2 PRs to determine if there's only one
270-
pull_requests = repository.pull_requests.values("id", "compared_to")[:2]
271-
if len(pull_requests) != 1:
272-
return False
273-
# For single PR, check if it's a valid first PR by verifying no compared_to
274-
return pull_requests[0]["compared_to"] is None
275-
except Exception as e:
276-
log.error(
277-
"Error checking is_first_pull_request, assuming False",
278-
extra=dict(repo_id=repository.repoid, error=str(e)),
279-
)
268+
# Get at most 2 PRs to determine if there's only one
269+
pull_requests = repository.pull_requests.values("id", "compared_to")[:2]
270+
if len(pull_requests) != 1:
280271
return False
272+
# For single PR, check if it's a valid first PR by verifying no compared_to
273+
return pull_requests[0]["compared_to"] is None
281274

282275

283276
@repository_bindable.field("isGithubRateLimited")

0 commit comments

Comments
 (0)