AniLink - v3.0.0
    Preparing search index...

    Function normalizeRequestError

    • Normalizes any value thrown during a request into the AniLinkError taxonomy, the single funnel every transport failure flows through.

      Already-normalized errors pass through with a missing requestId stamped; Axios errors are classified into AniLinkApiError (or AniLinkRestError on REST calls) for HTTP failures, and AniLinkNetworkError for timeouts, network faults, and cancellations; anything else is wrapped in a generic unknown-code AniLinkError.

      Parameters

      • resolved: ResolvedRequestOptions

        The resolved request options, for the timeout duration and the raw-error opt-in.

      • error: unknown

        The thrown value to normalize.

      • isRestCall: boolean = false

        Whether the failing call used the REST protocol, selecting AniLinkRestError over AniLinkApiError for HTTP failures.

      • OptionalrequestId: string

        The correlation ID to stamp onto the error, when available.

      Returns AniLinkError

      The normalized error, always safe to catch as an AniLinkError.