# provider-failure.ts

**[Source](https://github.com/ubugeeei-prod/ox-content/blob/main/npm/vite-plugin-ox-content/src/plugins/provider-failure.ts)**

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

<div class="ox-api-stats" aria-label="API reference summary">
<span class="ox-api-stat">
  <strong>5</strong>
  <span>symbols</span>
</span>
<span class="ox-api-stat">
  <strong>1</strong>
  <span>functions</span>
</span>
<span class="ox-api-stat">
  <strong>1</strong>
  <span>types</span>
</span>
<span class="ox-api-stat">
  <strong>2</strong>
  <span>variables</span>
</span>
<span class="ox-api-stat">
  <strong>1</strong>
  <span>modules</span>
</span>
<span class="ox-api-stat">
  <strong>1</strong>
  <span>parameters</span>
</span>
<span class="ox-api-stat">
  <strong>1</strong>
  <span>returns</span>
</span>
</div>

## Reference

<div class="ox-api-controls" data-ox-api-target=".ox-api-entry" role="toolbar" aria-label="Reference display controls">
<button type="button" class="ox-api-controls__button" data-ox-api-toggle="expand">Open all</button>
<button type="button" class="ox-api-controls__button" data-ox-api-toggle="collapse">Close all</button>
</div>

<details id="embedfailure" class="ox-api-entry">
  <summary><span class="ox-api-entry__kind">type</span><span class="ox-api-entry__summary-main"><code class="ox-api-entry__signature ox-api-entry__signature--highlighted language-typescript">EmbedFailure = { kind: &quot;unavailable&quot;; status: number } | { kind: &quot;missing&quot;; status: number } | { kind: &quot;fetch-failed&quot;; reason: string } | { kind: &quot;offline&quot;; reason: string }</code><span class="ox-api-entry__description">Why a build-time embed lookup did not produce metadata. Every fetcher used to c…</span></span></summary>
  <div class="ox-api-entry__body">
<div class="ox-api-entry__prose">
<p>Why a build-time embed lookup did not produce metadata.</p>
<p>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.</p>
</div>
<div class="ox-api-entry__section ox-api-entry__section--signature">
<h4>Signature</h4>
<pre><code class="language-typescript">export type EmbedFailure = { kind: &quot;unavailable&quot;; status: number } | { kind: &quot;missing&quot;; status: number } | { kind: &quot;fetch-failed&quot;; reason: string } | { kind: &quot;offline&quot;; reason: string }</code></pre>
</div>
<p class="ox-api-entry__source"><a class="ox-api-entry__source-link" href="https://github.com/ubugeeei-prod/ox-content/blob/main/npm/vite-plugin-ox-content/src/plugins/provider-failure.ts#L10-L18" target="_blank" rel="noopener noreferrer">View source<span class="ox-api-entry__source-icon" aria-hidden="true"></span></a></p>
  </div>
</details>

<details id="errorcode" class="ox-api-entry">
  <summary><span class="ox-api-entry__kind">fn</span><span class="ox-api-entry__summary-main"><code class="ox-api-entry__signature ox-api-entry__signature--highlighted language-typescript">errorCode(error: Error): string | undefined</code><span class="ox-api-entry__description">cause is where undici puts the syscall error; older runtimes use code.</span><span class="ox-api-entry__meta"><span class="ox-api-badge">1 param</span><span class="ox-api-badge">returns string | undefined</span></span></span></summary>
  <div class="ox-api-entry__body">
<div class="ox-api-entry__prose">
<p><code>cause</code> is where undici puts the syscall error; older runtimes use <code>code</code>.</p>
</div>
<div class="ox-api-entry__section ox-api-entry__section--signature">
<h4>Signature</h4>
<pre><code class="language-typescript">function errorCode(error: Error): string | undefined</code></pre>
</div>
<p class="ox-api-entry__source"><a class="ox-api-entry__source-link" href="https://github.com/ubugeeei-prod/ox-content/blob/main/npm/vite-plugin-ox-content/src/plugins/provider-failure.ts#L47-L55" target="_blank" rel="noopener noreferrer">View source<span class="ox-api-entry__source-icon" aria-hidden="true"></span></a></p>
<div class="ox-api-entry__section ox-api-entry__section--params">
<h4>Parameters</h4>
<ul class="ox-api-entry__params">
<li class="ox-api-entry__param">
  <div class="ox-api-entry__param-heading">
    <code class="ox-api-entry__param-name">error</code>
    <code class="ox-api-entry__param-type">Error</code>
  </div>
</li>
</ul>
</div>
<div class="ox-api-entry__section ox-api-entry__section--returns">
<h4>Returns</h4>
<div class="ox-api-entry__return">
  <code class="ox-api-entry__return-type">string | undefined</code>
</div>
</div>
  </div>
</details>

<details id="offline_codes" class="ox-api-entry">
  <summary><span class="ox-api-entry__kind">variable</span><span class="ox-api-entry__summary-main"><code class="ox-api-entry__signature ox-api-entry__signature--highlighted language-typescript">const OFFLINE_CODES = new Set([ &quot;ENOTFOUND&quot;, &quot;EAI_AGAIN&quot;, &quot;ECONNREFUSED&quot;, &quot;ENETUNREACH&quot;, &quot;ENETDOWN&quot;, &quot;EHOSTUNREACH&quot;, ])</code><span class="ox-api-entry__description">Node&#39;s fetch reports a missing network through cause.code.</span></span></summary>
  <div class="ox-api-entry__body">
<div class="ox-api-entry__prose">
<p>Node&#39;s fetch reports a missing network through <code>cause.code</code>.</p>
</div>
<div class="ox-api-entry__section ox-api-entry__section--signature">
<h4>Signature</h4>
<pre><code class="language-typescript">const OFFLINE_CODES = new Set([
  &quot;ENOTFOUND&quot;,
  &quot;EAI_AGAIN&quot;,
  &quot;ECONNREFUSED&quot;,
  &quot;ENETUNREACH&quot;,
  &quot;ENETDOWN&quot;,
  &quot;EHOSTUNREACH&quot;,
])</code></pre>
</div>
<p class="ox-api-entry__source"><a class="ox-api-entry__source-link" href="https://github.com/ubugeeei-prod/ox-content/blob/main/npm/vite-plugin-ox-content/src/plugins/provider-failure.ts#L21-L28" target="_blank" rel="noopener noreferrer">View source<span class="ox-api-entry__source-icon" aria-hidden="true"></span></a></p>
  </div>
</details>

<details id="offlinereported" class="ox-api-entry">
  <summary><span class="ox-api-entry__kind">variable</span><span class="ox-api-entry__summary-main"><code class="ox-api-entry__signature ox-api-entry__signature--highlighted language-typescript">let offlineReported = false</code><span class="ox-api-entry__description">An offline build fails every lookup for the same reason, so it says so once. On…</span></span></summary>
  <div class="ox-api-entry__body">
<div class="ox-api-entry__prose">
<p>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.</p>
</div>
<div class="ox-api-entry__section ox-api-entry__section--signature">
<h4>Signature</h4>
<pre><code class="language-typescript">let offlineReported = false</code></pre>
</div>
<p class="ox-api-entry__source"><a class="ox-api-entry__source-link" href="https://github.com/ubugeeei-prod/ox-content/blob/main/npm/vite-plugin-ox-content/src/plugins/provider-failure.ts#L76" target="_blank" rel="noopener noreferrer">View source<span class="ox-api-entry__source-icon" aria-hidden="true"></span></a></p>
  </div>
</details>

<details id="provider-failure" class="ox-api-entry">
  <summary><span class="ox-api-entry__kind">module</span><span class="ox-api-entry__summary-main"><code class="ox-api-entry__name">provider-failure</code><span class="ox-api-entry__description">Why a build-time embed lookup did not produce metadata. Every fetcher used to collapse these into one message carrying…</span></span></summary>
  <div class="ox-api-entry__body">
<div class="ox-api-entry__prose">
<p>Why a build-time embed lookup did not produce metadata.</p>
<p>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.</p>
</div>
<p class="ox-api-entry__source"><a class="ox-api-entry__source-link" href="https://github.com/ubugeeei-prod/ox-content/blob/main/npm/vite-plugin-ox-content/src/plugins/provider-failure.ts#L1-L8" target="_blank" rel="noopener noreferrer">View source<span class="ox-api-entry__source-icon" aria-hidden="true"></span></a></p>
  </div>
</details>
