Skip to content

Commit

Permalink
jobs: do not include nil error into a log message when stepping
Browse files Browse the repository at this point in the history
This is a bit annoying and makes things a bit more difficult to search
for actual errors.

Epic: None

Release note: None
  • Loading branch information
yuzefovich committed Nov 1, 2022
1 parent e45af1d commit dbb36de
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/jobs/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,11 @@ func (r *Registry) stepThroughStateMachine(
) error {
payload := job.Payload()
jobType := payload.Type()
log.Infof(ctx, "%s job %d: stepping through state %s with error: %+v", jobType, job.ID(), status, jobErr)
if jobErr != nil {
log.Infof(ctx, "%s job %d: stepping through state %s with error: %+v", jobType, job.ID(), status, jobErr)
} else {
log.Infof(ctx, "%s job %d: stepping through state %s", jobType, job.ID(), status)
}
jm := r.metrics.JobMetrics[jobType]
onExecutionFailed := func(cause error) error {
log.InfofDepth(
Expand Down

0 comments on commit dbb36de

Please sign in to comment.