usestd::collections::BTreeMap;useanyhow::Result;useserde::{Deserialize, Serialize};#[derive(Debug, Serialize, Deserialize)]pubstructErrorCode{pubcode: String,
pubdescription: String,
pubhttp_status_code:Option<u16>,
}/// A map from category name to a list of error codes.
pubtypeErrorCodeMap=BTreeMap<String, Vec<ErrorCode>>;/// Load S3 error codes from a JSON file.
////// # Errors
////// Returns an error if the file cannot be read or parsed.
pubfnload_json(path:&str)->Result<ErrorCodeMap>{let content =std::fs::read_to_string(path)?;let map: ErrorCodeMap =serde_json::from_str(&content)?;Ok(map)}