google / go-github

Go library for accessing the GitHub v3 API
https://pkg.go.dev/github.com/google/go-github/v67/github
BSD 3-Clause "New" or "Revised" License
10.47k stars 2.07k forks source link

Propagate *http.Response when encountering a *url.Error? #3362

Open akshayravikumar opened 3 days ago

akshayravikumar commented 3 days ago

Why does this code return nil for the response? I'm getting 404 errors (which can be permissions errors) but I'm not finding a good way to programmatically get the status code directly from the error object.

gmlewis commented 2 days ago

That's a good point. I don't see why we couldn't modify this endpoint to return the response so that the status code can be checked.

@akshayravikumar - do you want to write a PR to fix this, or shall I open this issue up to other contributors?