Log the root error in HandleFindRunnersFailure, when available

This commit is contained in:
Owen Strain
2019-05-02 18:36:28 -07:00
parent 14e5c34087
commit dc24491f98

View File

@@ -43,7 +43,12 @@ func (tr *placerTracker) IsDone() bool {
// HandleFindRunnersFailure is a convenience function to record error from runnerpool.Runners()
func (tr *placerTracker) HandleFindRunnersFailure(err error) {
common.Logger(tr.requestCtx).WithError(err).Error("Failed to find runners for call")
logger := common.Logger(tr.requestCtx).WithError(err)
w, ok := err.(models.APIErrorWrapper)
if ok {
logger = logger.WithField("root_error", w.RootError())
}
logger.Error("Failed to find runners for call")
stats.Record(tr.requestCtx, errorPoolCountMeasure.M(0))
}