Merge pull request #428 from jmorganca/mxyng/upload-chunks

update upload chunks
This commit is contained in:
Michael Yang
2023-08-30 07:47:17 -07:00
committed by GitHub
5 changed files with 87 additions and 47 deletions

View File

@@ -29,7 +29,7 @@ type Client struct {
}
func checkError(resp *http.Response, body []byte) error {
if resp.StatusCode >= 200 && resp.StatusCode < 400 {
if resp.StatusCode < http.StatusBadRequest {
return nil
}
@@ -165,7 +165,7 @@ func (c *Client) stream(ctx context.Context, method, path string, data any, fn f
return fmt.Errorf(errorResponse.Error)
}
if response.StatusCode >= 400 {
if response.StatusCode >= http.StatusBadRequest {
return StatusError{
StatusCode: response.StatusCode,
Status: response.Status,