earendil-works/pi · error · CborError
Decoded CBOR integer is outside the safe range
Error message
Decoded CBOR integer is outside the safe range
What it means
Error "Decoded CBOR integer is outside the safe range" thrown in earendil-works/pi.
Source
Thrown at packages/protocol/src/cbor/decoder.ts:39
const value = this.readItem(0);
if (this.offset !== this.bytes.byteLength) throw new CborError("CBOR payload contains trailing data");
return value;
}
private readItem(depth: number): unknown {
if (depth > this.options.maxDepth) {
throw new CborError(`CBOR nesting depth exceeds configured limit of ${this.options.maxDepth}`);
}
const initial = this.readByte();
const majorType = initial >>> 5;
const additionalInformation = initial & 0x1f;
switch (majorType) {
case 0:
return this.readArgument(additionalInformation);
case 1: {
const value = -1 - this.readArgument(additionalInformation);
if (!Number.isSafeInteger(value)) throw new CborError("Decoded CBOR integer is outside the safe range");
return value;
}
case 2: {
const length = this.readLength(additionalInformation, "byte string", this.options.maxByteLength);
return new Uint8Array(this.readBytes(length));
}
case 3: {
const length = this.readLength(additionalInformation, "text string", this.options.maxByteLength);
const bytes = this.readBytes(length);
try {
return textDecoder.decode(bytes);
} catch (_error) {
throw new CborError("CBOR text string contains invalid UTF-8");
}
}
case 4: {
const length = this.readLength(additionalInformation, "array", this.options.maxContainerLength);
const result: unknown[] = [];View on GitHub (pinned to 4af9d21d3b)
When it happens
Trigger: Thrown at packages/protocol/src/cbor/decoder.ts:39 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24).
Data as JSON: /api/errors/283dd00701246a32.
Report an issue: GitHub.