oven-sh/bun · error · Error

BrotliDecompressionError

Error message

BrotliDecompressionError

What it means

Sentinel variant of the brotli Error enum: the underlying brotli decoder (via the vendored library) reported a decompression failure, i.e. the input bytes were not a valid brotli stream or were corrupt mid-stream. The bare machine-readable name is the entire message; callers are expected to switch on the variant rather than parse the string.

Solutions

  1. Verify the payload is actually brotli-compressed and complete
  2. Check for upstream truncation or wrong Content-Encoding handling
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/brotli/error.rs:7 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/1fd47a95f2afe6e2. Report an issue: GitHub.

Appendix: source

Thrown at src/brotli/error.rs:7

#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)]
pub enum Error {
    #[error("BrotliFailedToLoad")]
    BrotliFailedToLoad,
    #[error("BrotliFailedToCreateInstance")]
    BrotliFailedToCreateInstance,
    #[error("BrotliDecompressionError")]
    BrotliDecompressionError,
    #[error("ShortRead")]
    ShortRead,
}

impl Error {
    #[allow(clippy::trivially_copy_pass_by_ref)]
    pub fn name(&self) -> &'static str {
        match self {
            Self::BrotliFailedToLoad => "BrotliFailedToLoad",
            Self::BrotliFailedToCreateInstance => "BrotliFailedToCreateInstance",
            Self::BrotliDecompressionError => "BrotliDecompressionError",
            Self::ShortRead => "ShortRead",
        }
    }
}

impl bun_core::output::ErrName for Error {

View on GitHub (pinned to 8c5296ac45)