Skip to content

Commit

Permalink
fix(api): ignore error if wkf holder not found when loading pipeline (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
richardlt authored May 18, 2020
1 parent d21537d commit 7491dbd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion engine/api/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,15 @@ func (api *API) getPipelineHandler() service.Handler {
wkAscodeHolder, err := workflow.LoadByRepo(ctx, api.Cache, api.mustDB(), *proj, p.FromRepository, workflow.LoadOptions{
WithTemplate: true,
})
if err != nil {
if err != nil && !sdk.ErrorIs(err, sdk.ErrNotFound) {
return sdk.NewErrorFrom(err, "cannot found workflow holder of the pipeline")
}
p.WorkflowAscodeHolder = wkAscodeHolder

// FIXME from_repository should never be set if the workflow holder was deleted
if p.WorkflowAscodeHolder == nil {
p.FromRepository = ""
}
}

return service.WriteJSON(w, p, http.StatusOK)
Expand Down

0 comments on commit 7491dbd

Please sign in to comment.