From 907142d372d1839d6139f0be3b39667cd06d57b9 Mon Sep 17 00:00:00 2001 From: Prakash Date: Tue, 2 Apr 2024 19:35:54 +0530 Subject: [PATCH] return nil,err on git material fetch error (#4857) --- pkg/pipeline/CiHandler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/pipeline/CiHandler.go b/pkg/pipeline/CiHandler.go index 0222e888e16..bf9c9e3bdb5 100644 --- a/pkg/pipeline/CiHandler.go +++ b/pkg/pipeline/CiHandler.go @@ -430,7 +430,7 @@ func (impl *CiHandlerImpl) FetchMaterialsByPipelineId(pipelineId int, showAll bo impl.Logger.Debugw("commits for material ", "m", m, "commits: ", changesResp) if apiErr != nil { impl.Logger.Warnw("git sensor FetchChanges failed for material", "id", m.Id) - return []pipelineConfig.CiPipelineMaterialResponse{}, apiErr + return nil, apiErr } ciMaterialHistoryMap[m] = changesResp } @@ -459,7 +459,7 @@ func (impl *CiHandlerImpl) FetchMaterialsByPipelineId(pipelineId int, showAll bo regexMaterials, err := impl.ciPipelineMaterialRepository.GetRegexByPipelineId(pipelineId) if err != nil { impl.Logger.Errorw("regex ciMaterials fetch failed", "err", err) - return []pipelineConfig.CiPipelineMaterialResponse{}, err + return nil, err } for _, k := range regexMaterials { r := pipelineConfig.CiPipelineMaterialResponse{