1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-11-29 21:48:14 +02:00

Dont panic, report error back (#582)

dont panic! return error back
This commit is contained in:
6543
2021-12-08 23:36:23 +01:00
committed by GitHub
parent 0061edcbe2
commit 3ec00140d9
4 changed files with 50 additions and 18 deletions

View File

@@ -371,7 +371,7 @@ func findOrPersistPipelineConfig(repo *model.Repo, build *model.Build, remoteYam
}
// publishes message to UI clients
func publishToTopic(c *gin.Context, build *model.Build, repo *model.Repo, event model.EventType) error {
func publishToTopic(c *gin.Context, build *model.Build, repo *model.Repo, event model.EventType) (err error) {
message := pubsub.Message{
Labels: map[string]string{
"repo": repo.FullName,
@@ -379,7 +379,10 @@ func publishToTopic(c *gin.Context, build *model.Build, repo *model.Repo, event
},
}
buildCopy := *build
buildCopy.Procs = model.Tree(buildCopy.Procs)
if buildCopy.Procs, err = model.Tree(buildCopy.Procs); err != nil {
return err
}
message.Data, _ = json.Marshal(model.Event{
Type: model.Enqueued,
Repo: *repo,