From 7d7c6a701b59075de07e02fb232162357add887f Mon Sep 17 00:00:00 2001 From: Jenae Janzen Date: Wed, 23 Aug 2023 13:20:01 -0400 Subject: [PATCH] stop retrying on 400 and 422 status codes --- go/porcelain/deploy.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/go/porcelain/deploy.go b/go/porcelain/deploy.go index f567caa2..c39b87c9 100644 --- a/go/porcelain/deploy.go +++ b/go/porcelain/deploy.go @@ -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 } }