From 2a1f2f3dd3fee935cc19b6300442c88d3b7ba6e2 Mon Sep 17 00:00:00 2001 From: Michael Marchetti Date: Tue, 5 Dec 2023 11:26:32 -0500 Subject: [PATCH] send failure event for top-level publishing operation --- internal/publish/publish.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/publish/publish.go b/internal/publish/publish.go index f99879025..58edeb6b8 100644 --- a/internal/publish/publish.go +++ b/internal/publish/publish.go @@ -90,6 +90,13 @@ func (p *defaultPublisher) publish( err = p.publishWithClient(bundler, p.Account, client, log) if err != nil { log.Failure(err) + + // Also fail the overall operation + agentErr, ok := err.(*types.AgentError) + if ok { + agentErr.SetOperation(events.PublishOp) + log.Failure(agentErr) + } } return nil } @@ -186,7 +193,7 @@ func (p *defaultPublisher) publishWithClient( } err = p.createDeploymentRecord(bundler, contentID, account, log) if err != nil { - return err + return types.ErrToAgentError(events.PublishCreateDeploymentOp, err) } bundleFile, err := os.CreateTemp("", "bundle-*.tar.gz")