Skip to main content

Function: createErrorResult()

createErrorResult(error: string, responseTime: number, correlationId?: string): MonitorCheckResult

Defined in: electron/services/monitoring/utils/errorHandling.ts:50

Constructs a standardized error result for monitor checks.

Parameters

error

string

The error message describing what went wrong.

responseTime

number

The response time in milliseconds at the point of failure.

correlationId?

string

Optional correlation ID for event tracking and logging.

Returns

MonitorCheckResult

A MonitorCheckResult object indicating failure.

Remarks

The details field is set to "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error" to distinguish error states from valid HTTP responses. This function is used for both network and generic errors. The returned object always has status: "down".

Example

createErrorResult("Timeout", 500, "corr-123");

See

MonitorCheckResult