Skip to content

Commit

Permalink
[Heartbeat]: capture error from journey/end events (#26781)
Browse files Browse the repository at this point in the history
(cherry picked from commit 11b545a)
  • Loading branch information
vigneshshanmugam authored and mergify-bot committed Jul 12, 2021
1 parent 4faeca5 commit a62ec43
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions x-pack/heartbeat/monitors/browser/synthexec/enrich.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ func (je *journeyEnricher) enrich(event *beat.Event, se *SynthEvent) error {
}

func (je *journeyEnricher) enrichSynthEvent(event *beat.Event, se *SynthEvent) error {
var jobErr error
if se.Error != nil {
jobErr = stepError(se.Error)
je.errorCount++
if je.firstError == nil {
je.firstError = jobErr
}
}

switch se.Type {
case "journey/end":
je.journeyComplete = true
Expand Down Expand Up @@ -133,16 +142,6 @@ func (je *journeyEnricher) enrichSynthEvent(event *beat.Event, se *SynthEvent) e
}
}
}

var jobErr error
if se.Error != nil {
jobErr = stepError(se.Error)
je.errorCount++
if je.firstError == nil {
je.firstError = jobErr
}
}

return jobErr
}

Expand Down

0 comments on commit a62ec43

Please sign in to comment.