{"record":{"id":"f59f4e288a021480","repo":"earendil-works/pi","slug":"cbor-nesting-depth-exceeds-configured-limit-of-t","errorCode":null,"errorMessage":"CBOR nesting depth exceeds configured limit of ${this.options.maxDepth}","messagePattern":"CBOR nesting depth exceeds configured limit of (.+?)","errorType":"exception","errorClass":"CborError","httpStatus":null,"severity":"error","filePath":"packages/protocol/src/cbor/decoder.ts","lineNumber":28,"sourceCode":"class CborReader {\n\tprivate readonly bytes: Uint8Array;\n\tprivate offset = 0;\n\tprivate readonly options: ResolvedCborOptions;\n\n\tconstructor(bytes: Uint8Array, options: ResolvedCborOptions) {\n\t\tthis.bytes = bytes;\n\t\tthis.options = options;\n\t}\n\n\tdecode(): unknown {\n\t\tconst value = this.readItem(0);\n\t\tif (this.offset !== this.bytes.byteLength) throw new CborError(\"CBOR payload contains trailing data\");\n\t\treturn value;\n\t}\n\n\tprivate readItem(depth: number): unknown {\n\t\tif (depth > this.options.maxDepth) {\n\t\t\tthrow new CborError(`CBOR nesting depth exceeds configured limit of ${this.options.maxDepth}`);\n\t\t}\n\t\tconst initial = this.readByte();\n\t\tconst majorType = initial >>> 5;\n\t\tconst additionalInformation = initial & 0x1f;\n\n\t\tswitch (majorType) {\n\t\t\tcase 0:\n\t\t\t\treturn this.readArgument(additionalInformation);\n\t\t\tcase 1: {\n\t\t\t\tconst value = -1 - this.readArgument(additionalInformation);\n\t\t\t\tif (!Number.isSafeInteger(value)) throw new CborError(\"Decoded CBOR integer is outside the safe range\");\n\t\t\t\treturn value;\n\t\t\t}\n\t\t\tcase 2: {\n\t\t\t\tconst length = this.readLength(additionalInformation, \"byte string\", this.options.maxByteLength);\n\t\t\t\treturn new Uint8Array(this.readBytes(length));\n\t\t\t}\n\t\t\tcase 3: {","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/protocol/src/cbor/decoder.ts#L10-L46","documentation":"Error \"CBOR nesting depth exceeds configured limit of ${this.options.maxDepth}\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/protocol/src/cbor/decoder.ts:28 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"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"}