Skip to content

Commit

Permalink
fix(checker): Don't rewrite error while compare trigger states (#1035)
Browse files Browse the repository at this point in the history
  • Loading branch information
kissken authored Jun 20, 2024
1 parent 17a4941 commit 78a7a88
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion checker/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,17 @@ func (triggerChecker *TriggerChecker) handleFetchError(checkData moira.CheckData
if timeSinceLastSuccessfulCheck >= triggerChecker.ttl {
checkData.State = moira.StateEXCEPTION
checkData.Message = fmt.Sprintf("Remote server unavailable. Trigger is not checked for %d seconds", timeSinceLastSuccessfulCheck)
checkData, err = triggerChecker.compareTriggerStates(checkData)

var comparingErr error
checkData, comparingErr = triggerChecker.compareTriggerStates(checkData)
if comparingErr != nil {
triggerChecker.logger.Error().
Error(comparingErr).
String(moira.LogFieldNameTriggerID, triggerChecker.triggerID).
Msg("cannot compare trigger states")
}
}

logTriggerCheckException(triggerChecker.logger, triggerChecker.triggerID, err)
case local.ErrUnknownFunction, local.ErrEvalExpr:
checkData.State = moira.StateEXCEPTION
Expand Down

0 comments on commit 78a7a88

Please sign in to comment.