API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classAssetNetworkError

@codexo/exojs / assets / stable

Structured asset-network failure. Raised whenever the network leg of a load fails - either because the request never completed (offline, DNS, CORS, TLS) or because the server answered with a non-`ok` status. Extends Error, so callers can narrow with `error instanceof AssetNetworkError` and read AssetNetworkError.url and AssetNetworkError.status instead of matching on message text. AssetNetworkError.status being `null` is itself the signal that no response arrived at all, which is what separates "the server said 404" from "the request never left the machine" - a distinction a flat `Error` could not express. For the transport case the original rejection stays reachable through Error.cause. A cancelled load is never reported through this type: an `AbortError` is rethrown untouched so cancellation stays distinguishable from failure.

7
props
0
methods
0
events
Import
import { AssetNetworkError } from '@codexo/exojs'

Structured asset-network failure. Raised whenever the network leg of a load fails - either because the request never completed (offline, DNS, CORS, TLS) or because the server answered with a non-`ok` status.

Extends Error, so callers can narrow with `error instanceof AssetNetworkError` and read AssetNetworkError.url and AssetNetworkError.status instead of matching on message text. AssetNetworkError.status being `null` is itself the signal that no response arrived at all, which is what separates "the server said 404" from "the request never left the machine" - a distinction a flat `Error` could not express. For the transport case the original rejection stays reachable through Error.cause.

A cancelled load is never reported through this type: an `AbortError` is rethrown untouched so cancellation stays distinguishable from failure.

Constructors1
Properties7
cause?: unknown
message: string
name: string
stack?: string
status: null | number
HTTP status code, or null when the request produced no response.
statusText: null | string
HTTP status text, or null when the request produced no response.
url: string
The URL that failed to load.
Source