{"record":{"id":"819cf85c1ab0e079","repo":"biomejs/biome","slug":"overflow-error","errorCode":null,"errorMessage":"overflow error","messagePattern":"overflow error","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"crates/biome_diagnostics/src/display/frame.rs","lineNumber":648,"sourceCode":"                || Cow::Owned(LineIndexBuf::from_source_text(source_code.text)),\n                Cow::Borrowed,\n            ),\n        }\n    }\n\n    /// Return the starting byte index of the line with the specified line index.\n    /// Convenience method that already generates errors if necessary.\n    fn line_start(&self, line_index: usize) -> io::Result<TextSize> {\n        use std::cmp::Ordering;\n\n        match line_index.cmp(&self.line_starts.len()) {\n            Ordering::Less => Ok(self\n                .line_starts\n                .get(line_index)\n                .copied()\n                .expect(\"failed despite previous check\")),\n            Ordering::Equal => Ok(self.source.text_len()),\n            Ordering::Greater => Err(io::Error::new(\n                io::ErrorKind::InvalidInput,\n                \"overflow error\",\n            )),\n        }\n    }\n\n    fn line_index(&self, byte_index: TextSize) -> usize {\n        self.line_starts\n            .binary_search(&byte_index)\n            .unwrap_or_else(|next_line| next_line - 1)\n    }\n\n    fn line_range(&self, line_index: usize) -> io::Result<TextRange> {\n        let line_start = self.line_start(line_index)?;\n        let next_line_start = self.line_start(line_index + 1)?;\n\n        Ok(TextRange::new(line_start, next_line_start))\n    }","sourceCodeStart":630,"sourceCodeEnd":666,"githubUrl":"https://github.com/biomejs/biome/blob/405dedb0ff65dd29927faf587f6542e3c29db248/crates/biome_diagnostics/src/display/frame.rs#L630-L666","documentation":"Error \"overflow error\" thrown in biomejs/biome.","triggerScenarios":"Thrown at crates/biome_diagnostics/src/display/frame.rs:648 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the requested line index does not exceed the number of lines in the file being rendered.","Validate the diagnostic location before building the code frame."],"exampleFix":"Clamp the diagnostic's line index to `line_starts.len()` before calling `line_start`.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"405dedb0ff65dd29927faf587f6542e3c29db248","analyzedAt":"2026-08-20T00:25:09.682Z","contentChangedAt":"2026-08-20T00:25:09.682Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}