Skip to content

fix: inconsistent 404 handling in GitHub API functions #71

Description

@BryanFRD

Describe the bug
In src/tools/github.ts, the two main fetch functions handle 404 differently:

  • fetchRepoFile — returns null on 404 (graceful)
  • fetchMatchingTags — throws GitHub API error: 404 on 404

When a package name doesn't match any tags, fetchMatchingTags should return an empty array instead of throwing, since "no matching tags" is a valid result (not an error).

Package
Which package is affected? [ ] server [x] tools [ ] docs

To Reproduce
Not provided in the original issue — to be filled in.

Expected behavior
Proposed fix:

Add 404 handling in fetchMatchingTags (around lines 106-109):

if (res.status === 404) return [];

Environment

  • Package version: main
  • Browser/OS (if frontend): n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priority

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions