Description
When fetching a repository fails due to an incorrect branch name, the error message "GitHub API Error:" provides no actionable guidance to the user.
Steps to Reproduce
- Go to https://githubtree.mgks.dev
- Enter
matteocrippa/awesome-swift
- Leave branch as
main (default)
- Click "Fetch"
- See unhelpful error: "GitHub API Error:"
Current Behavior
- Generic "GitHub API Error:" message with no details
- User has no idea what went wrong or how to fix it
Suggested Improvement
When a 422 error occurs on the commits endpoint, display a more helpful message like:
Branch not found. The branch main doesn't exist in this repository. Try master or check the repository for available branches.
Or even better — auto-detect the default branch using the Repos API which returns a default_branch field.
Environment
- Browser: Chrome
- Date: Jan 4, 2026
Description
When fetching a repository fails due to an incorrect branch name, the error message "GitHub API Error:" provides no actionable guidance to the user.
Steps to Reproduce
matteocrippa/awesome-swiftmain(default)Current Behavior
Suggested Improvement
When a 422 error occurs on the commits endpoint, display a more helpful message like:
Or even better — auto-detect the default branch using the Repos API which returns a
default_branchfield.Environment