{"record":{"id":"8953bb67713aa634","repo":"earendil-works/pi","slug":"name-must-be-an-integer-between-0-and-maximum","errorCode":null,"errorMessage":"${name} must be an integer between 0 and ${maximum}","messagePattern":"(.+?) must be an integer between 0 and (.+?)","errorType":"exception","errorClass":"RangeError","httpStatus":null,"severity":"error","filePath":"packages/protocol/src/cbor/options.ts","lineNumber":37,"sourceCode":"export interface ResolvedCborOptions {\n\tmaxByteLength: number;\n\tmaxContainerLength: number;\n\tmaxDepth: number;\n}\n\nexport class CborError extends Error {\n\tconstructor(message: string) {\n\t\tsuper(message);\n\t\tthis.name = \"CborError\";\n\t}\n}\n\nexport const textEncoder = new TextEncoder();\nexport const textDecoder = new TextDecoder(\"utf-8\", { fatal: true, ignoreBOM: true });\n\nfunction resolveLimit(name: string, value: number, maximum: number): number {\n\tif (!Number.isSafeInteger(value) || value < 0 || value > maximum) {\n\t\tthrow new RangeError(`${name} must be an integer between 0 and ${maximum}`);\n\t}\n\treturn value;\n}\n\nexport function resolveOptions(options: CborOptions | undefined): ResolvedCborOptions {\n\treturn {\n\t\tmaxByteLength: resolveLimit(\"maxByteLength\", options?.maxByteLength ?? DEFAULT_MAX_CBOR_BYTE_LENGTH, MAX_UINT32),\n\t\tmaxContainerLength: resolveLimit(\n\t\t\t\"maxContainerLength\",\n\t\t\toptions?.maxContainerLength ?? DEFAULT_MAX_CBOR_CONTAINER_LENGTH,\n\t\t\tMAX_UINT32,\n\t\t),\n\t\tmaxDepth: resolveLimit(\"maxDepth\", options?.maxDepth ?? DEFAULT_MAX_CBOR_DEPTH, MAX_CONFIGURED_DEPTH),\n\t};\n}\n","sourceCodeStart":19,"sourceCodeEnd":53,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/protocol/src/cbor/options.ts#L19-L53","documentation":"Error \"${name} must be an integer between 0 and ${maximum}\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/protocol/src/cbor/options.ts:37 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass an integer within the documented 0..maximum range for this option."],"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"}