Skip to main content

Function: handleCheckError()

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

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

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-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 Error("Unexpected failure"),
"https://example.com",
"corr-789"
);

See​

MonitorCheckResult