{"record":{"id":"3bcf25acedf74e3d","repo":"GitoxideLabs/gitoxide","slug":"bug-no-other-error-type-is-possible","errorCode":null,"errorMessage":"BUG: no other error type is possible","messagePattern":"BUG: no other error type is possible","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-pack/src/multi_index/verify.rs","lineNumber":115,"sourceCode":"    }\n\n    /// Similar to [`verify_integrity()`][File::verify_integrity()] but without any deep inspection of objects.\n    ///\n    /// Instead we only validate the contents of the multi-index itself.\n    pub fn verify_integrity_fast(\n        &self,\n        progress: &mut dyn DynNestedProgress,\n        should_interrupt: &AtomicBool,\n    ) -> Result<gix_hash::ObjectId, integrity::Error> {\n        self.verify_integrity_inner(\n            progress,\n            should_interrupt,\n            false,\n            index::verify::integrity::Options::default(),\n        )\n        .map_err(|err| match err {\n            index::traverse::Error::Processor(err) => err,\n            _ => unreachable!(\"BUG: no other error type is possible\"),\n        })\n        .map(|o| o.actual_index_checksum)\n    }\n\n    /// Similar to [`crate::Bundle::verify_integrity()`] but checks all contained indices and their packs.\n    ///\n    /// Note that it's considered a failure if an index doesn't have a corresponding pack.\n    pub fn verify_integrity<C, F>(\n        &self,\n        progress: &mut dyn DynNestedProgress,\n        should_interrupt: &AtomicBool,\n        options: index::verify::integrity::Options<F>,\n    ) -> Result<integrity::Outcome, index::traverse::Error<integrity::Error>>\n    where\n        C: crate::cache::DecodeEntry,\n        F: Fn() -> C + Send + Clone,\n    {\n        self.verify_integrity_inner(progress, should_interrupt, true, options)","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-pack/src/multi_index/verify.rs#L97-L133","documentation":"During a fast multi-index integrity verification, the per-index traversal is expected to fail only with `index::traverse::Error::Processor` (the caller-supplied processor error). Any other traversal error variant is treated as an unreachable bug and panics rather than being propagated.","triggerScenarios":"Calling `Bundle::verify_integrity_fast` (or the multi-index equivalent) when the underlying index traversal fails with a non-Processor error — e.g. pack decode/corruption errors from `index::traverse` that are not routed through the processor variant.","commonSituations":"Verifying a multi-index whose pack or idx files are corrupted or truncated; interrupted traversals surfacing unexpected variants; version skew where traverse::Error gained new variants the multi-index code does not map.","solutions":["Check the pack/idx files with `git verify-pack` or gix bundle verify to find and repair corruption","Re-clone or re-generate the affected pack/multi-index files","Upgrade gix-pack so all traverse error variants are mapped instead of panicking, and report the panic upstream"],"exampleFix":"// before\n_ => unreachable!(\"BUG: no other error type is possible\"),\n// after\nerr => return Err(Error::Verify(err.to_string())),","handlingStrategy":"try-catch","validationCode":"// pre-verify each idx/pack before the combined fast verify\nfor path in &index_paths { gix_pack::index::File::at(path, ...)?.verify_integrity(...)?; }","typeGuard":"fn is_processor_err(err: &index::traverse::Error) -> bool {\n    matches!(err, index::traverse::Error::Processor(_))\n}","tryCatchPattern":"match bundle.verify_integrity_fast(progress, should_interrupt) {\n    Ok(checksum) => checksum,\n    Err(e) => { log::error!(\"multi-index verification failed: {e}\"); return Err(e); }\n}","preventionTips":["Verify individual pack/index files before running multi-index verification","Keep gix-pack updated so traverse error variants stay fully mapped","Treat a panic here as a bug report trigger alongside corrupted-data investigation"],"tags":["rust","verification","pack","panic"],"backgroundTag":"internal-invariant-violation","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}