Skip to content

Commit

Permalink
[Heartbeat]: capture error from journey/end events
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshshanmugam committed Jul 8, 2021
1 parent 2af8ab9 commit 5fb289c
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 5fb289c

Please sign in to comment.