use std::{fmt, io}; #[allow(dead_code)] #[derive(Debug)] pub enum McError { Io(io::Error), Http(reqwest::Error), Json(serde_json::Error), Zip(zip::result::ZipError), Config(String), ShaMismatch(String), Process(String), Runtime(String), // ← NEW } impl fmt::Display for McError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{:?}", self) } } impl From for McError { fn from(e: io::Error) -> Self { Self::Io(e) } } impl From for McError { fn from(e: reqwest::Error) -> Self { Self::Http(e) } } impl From for McError { fn from(e: serde_json::Error) -> Self { Self::Json(e) } } impl From for McError { fn from(e: zip::result::ZipError) -> Self { Self::Zip(e) } }