Skip to content

Commit

Permalink
stop retrying on 400 and 422 status codes
Browse files Browse the repository at this point in the history
  • Loading branch information
jenae-janzen committed Aug 23, 2023
1 parent 2f75b17 commit 7d7c6a7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion go/porcelain/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,10 @@ func (n *Netlify) uploadFile(ctx context.Context, d *models.Deploy, f *FileBundl
}

// TODO this changes retry behaviour for the fileUpload case as well. OK?
if apiErr.Code()/100 == 4 {
if apiErr.Code() == 400 || apiErr.Code() == 422 {
sharedErr.mutex.Lock()
sharedErr.err = operationError
sharedErr.mutex.Unlock()
return nil
}
}
Expand Down

0 comments on commit 7d7c6a7

Please sign in to comment.