Skip to content

Commit 907142d

Browse files
return nil,err on git material fetch error (#4857)
1 parent ac6802f commit 907142d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/pipeline/CiHandler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ func (impl *CiHandlerImpl) FetchMaterialsByPipelineId(pipelineId int, showAll bo
430430
impl.Logger.Debugw("commits for material ", "m", m, "commits: ", changesResp)
431431
if apiErr != nil {
432432
impl.Logger.Warnw("git sensor FetchChanges failed for material", "id", m.Id)
433-
return []pipelineConfig.CiPipelineMaterialResponse{}, apiErr
433+
return nil, apiErr
434434
}
435435
ciMaterialHistoryMap[m] = changesResp
436436
}
@@ -459,7 +459,7 @@ func (impl *CiHandlerImpl) FetchMaterialsByPipelineId(pipelineId int, showAll bo
459459
regexMaterials, err := impl.ciPipelineMaterialRepository.GetRegexByPipelineId(pipelineId)
460460
if err != nil {
461461
impl.Logger.Errorw("regex ciMaterials fetch failed", "err", err)
462-
return []pipelineConfig.CiPipelineMaterialResponse{}, err
462+
return nil, err
463463
}
464464
for _, k := range regexMaterials {
465465
r := pipelineConfig.CiPipelineMaterialResponse{

0 commit comments

Comments
 (0)