zeroshade commented on code in PR #529: URL: https://github.com/apache/iceberg-go/pull/529#discussion_r2271035613
########## catalog/rest/rest.go: ########## @@ -335,46 +335,51 @@ func doPost[Payload, Result any](ctx context.Context, baseURI *url.URL, path []s return } -func handleNon200(rsp *http.Response, override map[int]error) error { - var e errorResponse +func handleNon200(rsp *http.Response, overrides map[int]error) error { + baseErr := errFromStatusCode(rsp.StatusCode) + if overrides != nil { + if override, ok := overrides[rsp.StatusCode]; ok { + baseErr = override + } + } Review Comment: should probably invert this. First check for the override, and if there's no override then use `errFromStatusCode` -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org