From 63a49ebb7a8fe08f2e6e6843c69b2b063196fe2d Mon Sep 17 00:00:00 2001 From: SpangleLabs Date: Mon, 1 Jul 2024 18:20:17 +0100 Subject: [PATCH] Log a warning when failing to add a replace directive label, rather than stopping with a fatal error --- sync/sync.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sync/sync.go b/sync/sync.go index cd6477e..c6a1f6a 100644 --- a/sync/sync.go +++ b/sync/sync.go @@ -12,10 +12,13 @@ import ( "github.com/please-build/puku/edit" "github.com/please-build/puku/graph" "github.com/please-build/puku/licences" + "github.com/please-build/puku/logging" "github.com/please-build/puku/please" "github.com/please-build/puku/proxy" ) +var log = logging.GetLogger() + type syncer struct { plzConf *please.Config graph *graph.Graph @@ -124,7 +127,7 @@ func (s *syncer) syncModFile(conf *config.Config, file *build.File, existingRule if matchingReplace != nil { err := edit.AddLabel(rule, REPLACE_LABEL) if err != nil { - return fmt.Errorf("failed to add replace label to %v: %v", req.Mod.Path, err) + log.Warningf("Failed to add replace label to %v: %v", req.Mod.Path, err) } } // No other changes needed