gphotosuploader / google-photos-api-client-go

Google Photos API client for your Go apps
https://pkg.go.dev/github.com/gphotosuploader/google-photos-api-client-go/v3
MIT License
41 stars 20 forks source link

check for permission errors etc #25

Closed fergald closed 4 years ago

fergald commented 5 years ago

Various places in https://github.com/gphotosuploader/google-photos-api-client-go/blob/master/lib-gphotos/uploads.go call .Do to send a request. They check the err returned but that err is unset if the http request executes correctly but returns a non-200 status.

Something needs to also check res.StatusCode

https://golang.org/pkg/net/http/#Response

Otherwise you get mysterious failures with no useful error output. In my case it's an authentication error.

Sorry not in a good position to supply a patch but it seems like it should be fairly trivial.