diff --git a/src/config.rs b/src/config.rs index 71ec2d408..d2426dedc 100644 --- a/src/config.rs +++ b/src/config.rs @@ -14,9 +14,16 @@ use std::env; use std::path::PathBuf; +use thiserror::Error; use jujutsu_lib::settings::UserSettings; +#[derive(Error, Debug)] +pub enum ConfigError { + #[error(transparent)] + ConfigReadError(#[from] config::ConfigError), +} + fn config_path() -> Option { if let Ok(config_path) = env::var("JJ_CONFIG") { // TODO: We should probably support colon-separated (std::env::split_paths) @@ -56,7 +63,7 @@ fn env_overrides() -> config::Config { builder.build().unwrap() } -pub fn read_config() -> Result { +pub fn read_config() -> Result { let mut config_builder = config::Config::builder().add_source(env_base()); if let Some(config_path) = config_path() {