oven-sh/bun · error · Error

ShortRead

Error message

ShortRead

What it means

Sentinel variant of the brotli Error enum: a read from the compressed input ended before the brotli decoder had consumed a complete stream, so decompression cannot finish. Like the other variants, the message is just the machine-readable name; consumers match on the enum variant rather than the string.

Solutions

  1. Ensure the full compressed payload is passed before finishing
  2. Check the reader for early close/truncation
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

Thrown at src/brotli/error.rs:9

#[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 {
    fn name(&self) -> &[u8] {
        (*self).name().as_bytes()

View on GitHub (pinned to 8c5296ac45)