{"record":{"id":"dbe2f4742619f3a3","repo":"oven-sh/bun","slug":"messagetoobig","errorCode":"MessageTooBig","errorMessage":"TooLarge","messagePattern":"TooLarge","errorType":"error_code","errorClass":"DecompressError","httpStatus":null,"severity":"error","filePath":"src/http_jsc/websocket_client/WebSocketDeflate.rs","lineNumber":95,"sourceCode":"const Z_DEFAULT_STRATEGY: c_int = 0;\nconst Z_DEFAULT_MEM_LEVEL: c_int = 8;\n\n// Buffer size for compression/decompression operations\nconst COMPRESSION_BUFFER_SIZE: usize = 4096;\n\n// Maximum decompressed message size (128 MB)\nconst MAX_DECOMPRESSED_SIZE: usize = 128 * 1024 * 1024;\n\n// DEFLATE trailer bytes added by Z_SYNC_FLUSH\nconst DEFLATE_TRAILER: [u8; 4] = [0x00, 0x00, 0xff, 0xff];\n\n#[derive(thiserror::Error, strum::IntoStaticStr, Debug)]\npub enum DecompressError {\n    #[error(\"InflateFailed\")]\n    InflateFailed,\n    #[error(\"OutOfMemory\")]\n    OutOfMemory,\n    #[error(\"TooLarge\")]\n    TooLarge,\n}\n\n#[derive(thiserror::Error, strum::IntoStaticStr, Debug)]\npub enum CompressError {\n    #[error(\"DeflateFailed\")]\n    DeflateFailed,\n    #[error(\"OutOfMemory\")]\n    OutOfMemory,\n}\n\nimpl PerMessageDeflate {\n    pub(crate) fn init(params: Params) -> crate::Result<Box<Self>> {\n        // Initialize compressor (deflate)\n        // We use negative window bits for raw DEFLATE, as required by RFC 7692.\n        let compress_stream = zlib::DeflateEncoder::new(\n            Z_DEFAULT_COMPRESSION,\n            -(params.client_max_window_bits as c_int),","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/src/http_jsc/websocket_client/WebSocketDeflate.rs#L77-L113","documentation":"Error \"TooLarge\" thrown in oven-sh/bun.","triggerScenarios":"Thrown at src/http_jsc/websocket_client/WebSocketDeflate.rs:95 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":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}