fail method

HealthCheckResult fail({
  1. T? observedValue,
  2. String? output,
  3. DateTime? time,
})

Creates a failing health check result for this indicator.

This method automatically populates name, componentId, componentType, and observedUnit from this indicator's properties.

Implementation

HealthCheckResult fail({
  T? observedValue,
  String? output,
  DateTime? time,
}) {
  return HealthCheckResult._(
    name: name,
    status: HealthStatus.fail,
    componentId: componentId,
    componentType: componentType,
    observedValue: observedValue,
    observedUnit: observedUnit,
    output: output,
    time: time ?? DateTime.now().toUtc(),
  );
}