oven-sh/bun · error · DecompressError
MessageTooBig
MessageTooBig
Error message
TooLarge
What it means
Error "TooLarge" thrown in oven-sh/bun.
Source
Thrown at src/http_jsc/websocket_client/WebSocketDeflate.rs:95
const Z_DEFAULT_STRATEGY: c_int = 0;
const Z_DEFAULT_MEM_LEVEL: c_int = 8;
// Buffer size for compression/decompression operations
const COMPRESSION_BUFFER_SIZE: usize = 4096;
// Maximum decompressed message size (128 MB)
const MAX_DECOMPRESSED_SIZE: usize = 128 * 1024 * 1024;
// DEFLATE trailer bytes added by Z_SYNC_FLUSH
const DEFLATE_TRAILER: [u8; 4] = [0x00, 0x00, 0xff, 0xff];
#[derive(thiserror::Error, strum::IntoStaticStr, Debug)]
pub enum DecompressError {
#[error("InflateFailed")]
InflateFailed,
#[error("OutOfMemory")]
OutOfMemory,
#[error("TooLarge")]
TooLarge,
}
#[derive(thiserror::Error, strum::IntoStaticStr, Debug)]
pub enum CompressError {
#[error("DeflateFailed")]
DeflateFailed,
#[error("OutOfMemory")]
OutOfMemory,
}
impl PerMessageDeflate {
pub(crate) fn init(params: Params) -> crate::Result<Box<Self>> {
// Initialize compressor (deflate)
// We use negative window bits for raw DEFLATE, as required by RFC 7692.
let compress_stream = zlib::DeflateEncoder::new(
Z_DEFAULT_COMPRESSION,
-(params.client_max_window_bits as c_int),View on GitHub (pinned to 8c5296ac45)
When it happens
Trigger: Thrown at src/http_jsc/websocket_client/WebSocketDeflate.rs:95 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16).
Data as JSON: /api/errors/dbe2f4742619f3a3.
Report an issue: GitHub.