From 4ab8e0d1cd9df819d0cbe935b85edf3ac61a7a7b Mon Sep 17 00:00:00 2001 From: tdurieux Date: Thu, 7 May 2026 07:42:05 +0300 Subject: [PATCH] Handle GitHub 409 "repository is empty" error in getCommitInfo When a GitHub repo has no commits, the API returns 409 which was unhandled, causing raw HttpError warnings. Now throws repo_empty AnonymousError consistent with the existing convention. --- src/core/source/GitHubRepository.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/source/GitHubRepository.ts b/src/core/source/GitHubRepository.ts index 4ac689f..439a880 100644 --- a/src/core/source/GitHubRepository.ts +++ b/src/core/source/GitHubRepository.ts @@ -64,6 +64,13 @@ export class GitHubRepository { return commit.data; } catch (error) { const status = (error as { status?: number }).status; + if (status === 409) { + throw new AnonymousError("repo_empty", { + httpStatus: 409, + cause: error as Error, + object: this, + }); + } if (status === 404 || status === 422) { // Distinguish: does the repo itself still exist? let repoExists: boolean;