Skip to content

data-pending

All codes

  • Type: error
  • Kind: state (the call isn’t valid in the object’s current state)

What happened

The ByteSource hasn’t fetched the listed byte ranges yet (ADR 0005 §2).

Why

Range loading: the call needs more of the file.

How to fix

Fetch the ranges and retry the call; the document stays usable.

Example

const doc = await Document.openRange(httpRangeSource(url));
// pages() needs bytes that haven't arrived: ensure() fetches e.ranges and retries
const pages = await doc.ensure(() => doc.pages);

Data fields

ranges (offset, length pairs).