hypercall/catalog_manager/
config.rs1use anyhow::{Context, Result};
7use catalog_manager::{parse_catalog_config, CatalogConfig};
8use std::path::Path;
9
10pub fn load_catalog_config<P: AsRef<Path>>(path: P) -> Result<CatalogConfig> {
11 let path = path.as_ref();
12 let contents = std::fs::read_to_string(path)
13 .with_context(|| format!("Failed to read catalog config from {:?}", path))?;
14 parse_catalog_config(&contents)
15 .with_context(|| format!("Failed to parse catalog config from {:?}", path))
16}