{"record":{"id":"7d8786cab88865e5","repo":"earendil-works/pi","slug":"truncated-frame-at-end-of-stream","errorCode":null,"errorMessage":"Truncated frame at end of stream","messagePattern":"Truncated frame at end of stream","errorType":"exception","errorClass":"FrameError","httpStatus":null,"severity":"error","filePath":"packages/protocol/src/framing.ts","lineNumber":163,"sourceCode":"\n\tend(): void {\n\t\tif (this.state === \"ended\") throw new FrameError(\"Frame decoder has ended\");\n\t\tif (this.state === \"failed\") throw new FrameError(\"Frame decoder has failed\");\n\t\tif (this.headerLength !== 0 || this.expectedPayloadLength !== undefined) {\n\t\t\tthis.fail(\"Truncated frame at end of stream\");\n\t\t}\n\t\tthis.state = \"ended\";\n\t}\n\n\tprivate fail(message: string): never {\n\t\tthis.state = \"failed\";\n\t\tthis.headerLength = 0;\n\t\tthis.payloadBlocks = [];\n\t\tthis.currentPayloadBlock = undefined;\n\t\tthis.currentPayloadBlockLength = 0;\n\t\tthis.expectedPayloadLength = undefined;\n\t\tthis.payloadLength = 0;\n\t\tthrow new FrameError(message);\n\t}\n}\n","sourceCodeStart":145,"sourceCodeEnd":166,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/protocol/src/framing.ts#L145-L166","documentation":"Error \"Truncated frame at end of stream\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/protocol/src/framing.ts:163 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The stream ended mid-frame; ensure the writer flushed complete frames before closing."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}