Skip to content

Commit

Permalink
fix error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
bootjp committed Mar 31, 2021
1 parent 4fc15fe commit f0c39cf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,16 @@ func DetectFailJobs(jobs []*gojenkins.Job) []*FailJob {
ej := &FailJob{
JenkinsJob: job,
Err: err,
Reason: ReasonOverHoursFailedJob,
Reason: ReasonJenkinsError,
}
errorJobs = append(errorJobs, ej)
}
}

if lastBuild == nil {
log.Fatalln("latest build is nil")
}

switch lastBuild.GetResult() {
case JenkinsResultFail:

Expand Down

0 comments on commit f0c39cf

Please sign in to comment.