Error messages in git.ts mislabel connection test failures as repository creation failures #14

Closed
opened 2026-05-09 05:19:31 +00:00 by Mark · 1 comment
Owner

Severity: Low (misleading error messages)

File: src/lib/git.ts

Issues:

  1. In testGitHubConnection (line 52), the catch block says:
    return { success: false, error: \Could not create repository: ...` }`
    This function tests the connection, not creates a repository — the error message is wrong.

  2. Same pattern in pushFilesToGitHub (line 128) — also says "Could not create repository" when it should say "Failed to push files".

Fix: Correct the error messages to accurately describe what was happening when the error occurred.

**Severity:** Low (misleading error messages) **File:** `src/lib/git.ts` **Issues:** 1. In `testGitHubConnection` (line 52), the catch block says: `return { success: false, error: \`Could not create repository: ...\` }` This function tests the connection, not creates a repository — the error message is wrong. 2. Same pattern in `pushFilesToGitHub` (line 128) — also says "Could not create repository" when it should say "Failed to push files". **Fix:** Correct the error messages to accurately describe what was happening when the error occurred.
Mark closed this issue 2026-05-20 09:01:47 +00:00
Author
Owner

This issue was already fixed in a subsequent commit. All 4 mislabeled error messages in src/lib/git.ts now correctly describe their context:

  • testGitHubConnection catch: "Failed to connect to GitHub" (was "Could not create repository")
  • pushFilesToGitHub catch: "Failed to push files" (was "Could not create repository")
  • testForgejoConnection catch: "Failed to connect to Forgejo" (was "Could not create repository")
  • pushFilesToForgejo catch: "Failed to push files" (was "Could not create repository")

The 2 remaining "Could not create repository" messages are in createGitHubRepo and createForgejoRepo where they are correct. No code changes needed.

This issue was already fixed in a subsequent commit. All 4 mislabeled error messages in `src/lib/git.ts` now correctly describe their context: - `testGitHubConnection` catch: "Failed to connect to GitHub" (was "Could not create repository") - `pushFilesToGitHub` catch: "Failed to push files" (was "Could not create repository") - `testForgejoConnection` catch: "Failed to connect to Forgejo" (was "Could not create repository") - `pushFilesToForgejo` catch: "Failed to push files" (was "Could not create repository") The 2 remaining "Could not create repository" messages are in `createGitHubRepo` and `createForgejoRepo` where they are correct. No code changes needed.
Sign in to join this conversation.
No description provided.