The outcome of an artefact read. bytes present ⇒ the artefact was read. bytes absent carries the underlying cause when the read FAILED (a thrown fs.readFile / fetch, e.g. ENOENT or a network error); the cause is absent only when the fetch itself succeeded but the HTTP status was non-ok (a legitimate "artefact not served here" with no JS error to attribute).

interface ArtefactReadResult {
    bytes: undefined | Uint8Array<ArrayBufferLike>;
    cause?: unknown;
}

Properties

Properties

bytes: undefined | Uint8Array<ArrayBufferLike>

The artefact bytes, or undefined when the read did not produce them.

cause?: unknown

The underlying read failure when bytes is absent because the read THREW (ENOENT / permission / network). Absent when the read succeeded, or when it was an HTTP-non-ok miss (no JS error to attribute).