From e3a142976ee2b5cae0f9a190c175687c13338689 Mon Sep 17 00:00:00 2001 From: Lars Lehtonen Date: Tue, 25 Jul 2023 05:52:49 -0700 Subject: [PATCH] internal/server/boltdbstate: fix dropped errors --- internal/server/boltdbstate/pipeline_run.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/server/boltdbstate/pipeline_run.go b/internal/server/boltdbstate/pipeline_run.go index aa4a267e39a..2781d71c18c 100644 --- a/internal/server/boltdbstate/pipeline_run.go +++ b/internal/server/boltdbstate/pipeline_run.go @@ -107,6 +107,9 @@ func (s *State) PipelineRunGetByJobId(ctx context.Context, jobId string) (*pb.Pi var result *pb.PipelineRun err := s.db.View(func(dbTxn *bolt.Tx) error { job, err := s.jobById(dbTxn, jobId) + if err != nil { + return err + } if job.Pipeline == nil { err = status.Errorf(codes.FailedPrecondition, "no pipeline run associated with job %q", job) return err @@ -117,6 +120,9 @@ func (s *State) PipelineRunGetByJobId(ctx context.Context, jobId string) (*pb.Pi }, } p, err := s.pipelineGet(dbTxn, memTxn, ref) + if err != nil { + return err + } result, err = s.pipelineRunGet(dbTxn, memTxn, p.Id, job.Pipeline.RunSequence) return err }) @@ -135,6 +141,9 @@ func (s *State) PipelineRunGet(ctx context.Context, ref *pb.Ref_Pipeline, seq ui var result *pb.PipelineRun err := s.db.View(func(dbTxn *bolt.Tx) error { p, err := s.pipelineGet(dbTxn, memTxn, ref) + if err != nil { + return err + } result, err = s.pipelineRunGet(dbTxn, memTxn, p.Id, seq) return err })