Skip to content

Commit 3625c5a

Browse files
committed
handle panic in GetCiPipelineById
1 parent 08fa6d6 commit 3625c5a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/pipeline/BuildPipelineConfigService.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,8 @@ func (impl *CiPipelineConfigServiceImpl) GetCiPipelineById(pipelineId int) (ciPi
680680
if err != nil && !util.IsErrNoRows(err) {
681681
impl.logger.Errorw("error in fetching ci pipeline", "pipelineId", pipelineId, "err", err)
682682
return nil, err
683+
} else if util.IsErrNoRows(err) {
684+
return nil, util.NewApiError(http.StatusNotFound, "ci pipeline not found", "ci pipeline not found ")
683685
}
684686
dockerArgs := make(map[string]string)
685687
if len(pipeline.DockerArgs) > 0 {

0 commit comments

Comments
 (0)