provider-failure.ts#
5 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.
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 }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 | undefinedParameters
-
errorError
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",
])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 = falsemoduleprovider-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.