Skip to content

Commit 7d7c6a7

Browse files
committed
stop retrying on 400 and 422 status codes
1 parent 2f75b17 commit 7d7c6a7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

go/porcelain/deploy.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,10 @@ func (n *Netlify) uploadFile(ctx context.Context, d *models.Deploy, f *FileBundl
546546
}
547547

548548
// TODO this changes retry behaviour for the fileUpload case as well. OK?
549-
if apiErr.Code()/100 == 4 {
549+
if apiErr.Code() == 400 || apiErr.Code() == 422 {
550+
sharedErr.mutex.Lock()
551+
sharedErr.err = operationError
552+
sharedErr.mutex.Unlock()
550553
return nil
551554
}
552555
}

0 commit comments

Comments
 (0)