Skip to main content

Function: handleCheckError()

handleCheckError(error: unknown, url: string, correlationId?: string): MonitorCheckResult

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

Handles unknown errors that occur during health checks, with correlation tracking.

Parameters

error

unknown

The unknown error thrown during monitoring (can be any type).

url

string

The URL being monitored when the error occurred.

correlationId?

string

Optional correlation ID for event tracking and logging.

Returns

MonitorCheckResult

A MonitorCheckResult object representing the error.

Remarks

Attempts to extract response time from Axios errors if available. For non-https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/Error objects, uses "Unknown error" as a fallback message. Logs all errors for diagnostic purposes. Always returns a MonitorCheckResult and never throws.

Example

handleCheckError(
new https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error("Unexpected failure"),
"https://example.com",
"corr-789"
);

See

MonitorCheckResult