ferhatelmas commented on code in PR #670:
URL: https://github.com/apache/iceberg-go/pull/670#discussion_r2677670480
##########
catalog/rest/rest.go:
##########
@@ -357,10 +357,15 @@ func doPostAllowNoContent[Payload, Result any](ctx
context.Context, baseURI *url
func handleNon200(rsp *http.Response, override map[int]error) error {
var e errorResponse
- dec := json.NewDecoder(rsp.Body)
- dec.Decode(&struct {
- Error *errorResponse `json:"error"`
- }{Error: &e})
Review Comment:
I was reviewing errors in the context of
https://github.com/apache/iceberg-go/pull/667 and thought enabling errcheck
would be better. This is one of the reported failures so trying to address
> if the body was empty then this would essentially be a no-op and nothing
would happen
that's correct but if there is a body and it fails to decode, it would be
ignored, now it's more explicit
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]