earendil-works/pi · error · ProtocolValidationError
Invalid ${this.kind} protocol frame: ${boundedErrorMessage(e
Error message
Invalid ${this.kind} protocol frame: ${boundedErrorMessage(error)} What it means
Error "Invalid ${this.kind} protocol frame: ${boundedErrorMessage(error)}" thrown in earendil-works/pi.
Source
Thrown at packages/protocol/src/codec.ts:113
constructor(kind: string, parse: (candidate: unknown) => T, options?: FrameDecoderOptions) {
this.frames = new FrameDecoder(options);
this.kind = kind;
this.maxFrameLength = options?.maxFrameLength ?? DEFAULT_MAX_FRAME_LENGTH;
this.parse = parse;
}
push(chunk: Uint8Array): T[] {
if (this.failed) throw new ProtocolValidationError(`${this.kind} message decoder has failed`);
try {
const messages: T[] = [];
for (const frame of this.frames.push(chunk)) {
messages.push(this.parse(decodeCbor(frame, { maxByteLength: this.maxFrameLength })));
}
return messages;
} catch (error) {
this.failed = true;
if (error instanceof ProtocolValidationError) throw error;
throw new ProtocolValidationError(`Invalid ${this.kind} protocol frame: ${boundedErrorMessage(error)}`);
}
}
end(): void {
if (this.failed) throw new ProtocolValidationError(`${this.kind} message decoder has failed`);
try {
this.frames.end();
} catch (error) {
this.failed = true;
throw new ProtocolValidationError(`Invalid ${this.kind} protocol framing: ${boundedErrorMessage(error)}`);
}
}
}
/** Incrementally decodes and validates framed client messages. */
export class ClientMessageDecoder {
private readonly decoder: ValidatedMessageDecoder<ClientMessage>;
View on GitHub (pinned to 4af9d21d3b)
Solutions
- The frame content failed to decode; verify both peers use the same protocol version and codec.
When it happens
Trigger: Thrown at packages/protocol/src/codec.ts:113 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/777a4158ae360806.
Report an issue: GitHub.