From 2a43e2c17a9ba0d78255803096e2ea128d6b0b0f Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Fri, 4 Oct 2024 23:21:40 +0200 Subject: [PATCH] fix: ignore error when binary is already published --- cmd/account/account_producer_extension_upload.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/account/account_producer_extension_upload.go b/cmd/account/account_producer_extension_upload.go index b32aad9..22a8362 100644 --- a/cmd/account/account_producer_extension_upload.go +++ b/cmd/account/account_producer_extension_upload.go @@ -3,6 +3,7 @@ package account import ( "fmt" "path/filepath" + "strings" "time" "github.com/spf13/cobra" @@ -114,7 +115,10 @@ var accountCompanyProducerExtensionUploadCmd = &cobra.Command{ err = p.UpdateExtensionBinaryFile(cmd.Context(), ext.Id, foundBinary.Id, path) if err != nil { - return err + if strings.Contains(err.Error(), "BinariesException-40") { + logging.FromContext(cmd.Context()).Infof("Binary version is already published. Skipping upload") + return nil + } } logging.FromContext(cmd.Context()).Infof("Submitting code review request")