Skip to main content

Function: handleAxiosError()

handleAxiosError(error: AxiosError, url: string, responseTime: number, correlationId?: string): MonitorCheckResult

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

Handles Axios-specific errors encountered during HTTP monitoring.

Parameters

error

AxiosError

The ://axios-http.com/docs/handling_errors instance containing request/response details.

url

string

The URL that was being monitored when the error occurred.

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 representing the network error.

Remarks

Intended for network errors such as timeouts, DNS failures, or connection refusals. HTTP response errors (status codes) are handled separately in the success path. Always returns a failure result; never throws.

Example

handleAxiosError(error, "https://example.com", 1200, "corr-456");

See