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)
| 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. |
| 296 | func isNotFound(err error) bool { |
| 297 | httpErr, ok := errors.AsType[api.HTTPError](err) |
| 298 | return ok && httpErr.StatusCode == http.StatusNotFound |
| 299 | } |
| 300 | |
| 301 | func StubFetchRelease(t *testing.T, reg *httpmock.Registry, owner, repoName, tagName, responseBody string) { |
| 302 | path := "repos/OWNER/REPO/releases/tags/v1.2.3" |
no outgoing calls
no test coverage detected