Skip to content

Function: networkError()

@providerprotocol/ai


@providerprotocol/ai / http / networkError

networkError(error, provider, modality): UPPError

Defined in: src/http/errors.ts:147

Creates a UPPError for network failures (DNS, connection, etc.).

Use this when the request fails before receiving any HTTP response, such as DNS resolution failures, connection refused, or network unreachable.

Error

The underlying Error that caused the failure

string

Provider identifier for error context

Modality

Request modality for error context

UPPError

A UPPError with NETWORK_ERROR code and the original error attached