MCPcopy Create free account
hub / github.com/cli/cli / isNotFound

Function isNotFound

pkg/cmd/release/shared/fetch.go:296–299  ·  view source on GitHub ↗

isNotFound reports whether err is an API error carrying a 404 status. The release lookups treat a missing release as a sentinel rather than an error, and the api client reports the status through an HTTPError rather than through a response the call site can inspect.

(err error)

Source from the content-addressed store, hash-verified

294// treat a missing release as a sentinel rather than an error, and the api client reports the
295// status through an HTTPError rather than through a response the call site can inspect.
296func isNotFound(err error) bool {
297 httpErr, ok := errors.AsType[api.HTTPError](err)
298 return ok && httpErr.StatusCode == http.StatusNotFound
299}
300
301func StubFetchRelease(t *testing.T, reg *httpmock.Registry, owner, repoName, tagName, responseBody string) {
302 path := "repos/OWNER/REPO/releases/tags/v1.2.3"

Callers 2

FetchRefSHAFunction · 0.70
fetchReleasePathFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected