go-gitea / go-sdk

Gitea: Golang SDK, moved to https://gitea.com/gitea/go-sdk
http://gitea.io
MIT License
29 stars 53 forks source link

Client: handle 409 HTTP code #132

Closed noerw closed 5 years ago

noerw commented 5 years ago

This is helpful, as POST /api/v1/releases returns no HTTP body for a 409 request, eg when there already is a release for the specified tag.

The underlying problem is bigger: The Client cannot handle error responses which do not contain a valid JSON body. I tried to solve it by still printing a usable error message instead of a JSON parsing error