Skip to content

provider-failure.ts#

View Markdown

Source

5 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.

5 symbols 1 functions 1 types 2 variables 1 modules 1 parameters 1 returns

Reference#

typeEmbedFailure = { kind: "unavailable"; status: number } | { kind: "missing"; status: number } | { kind: "fetch-failed"; reason: string } | { kind: "offline"; reason: string }Why a build-time embed lookup did not produce metadata. Every fetcher used to c…

Why a build-time embed lookup did not produce metadata.

Every fetcher used to collapse these into one message carrying a status code or an error string, so a rate limit read the same as a deleted resource and a disconnected machine read the same as a typo. The card that ships is the same either way; the difference matters to whoever reads the build log.

Signature

export type EmbedFailure = { kind: "unavailable"; status: number } | { kind: "missing"; status: number } | { kind: "fetch-failed"; reason: string } | { kind: "offline"; reason: string }

View source

fnerrorCode(error: Error): string | undefinedcause is where undici puts the syscall error; older runtimes use code.

cause is where undici puts the syscall error; older runtimes use code.

Signature

function errorCode(error: Error): string | undefined

View source

Parameters

  • error Error

Returns

string | undefined
variableconst OFFLINE_CODES = new Set([ "ENOTFOUND", "EAI_AGAIN", "ECONNREFUSED", "ENETUNREACH", "ENETDOWN", "EHOSTUNREACH", ])Node's fetch reports a missing network through cause.code.

Node's fetch reports a missing network through cause.code.

Signature

const OFFLINE_CODES = new Set([
  "ENOTFOUND",
  "EAI_AGAIN",
  "ECONNREFUSED",
  "ENETUNREACH",
  "ENETDOWN",
  "EHOSTUNREACH",
])

View source

variablelet offlineReported = falseAn offline build fails every lookup for the same reason, so it says so once. On…

An offline build fails every lookup for the same reason, so it says so once. One line per embed would bury the single fact that matters.

Signature

let offlineReported = false

View source

moduleprovider-failureWhy a build-time embed lookup did not produce metadata. Every fetcher used to collapse these into one message carrying…

Why a build-time embed lookup did not produce metadata.

Every fetcher used to collapse these into one message carrying a status code or an error string, so a rate limit read the same as a deleted resource and a disconnected machine read the same as a typo. The card that ships is the same either way; the difference matters to whoever reads the build log.

View source