You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let config = Config::builder().add_source(File::from_str(CONFIG_DATA, config::FileFormat::Toml))//source1.add_source(//source2
config::Environment::with_prefix(APP_NAME.to_uppercase().as_str()).try_parsing(true).separator("_").list_separator(","),);let res = config.add_source(File::with_name(config_path.to_str().expect("Failed to convert path to string")))source3
.build().map_err(|e| {error!("Failed to load config: {:?}", e);
e
});
This code, which returns ConfigError。so,I can't try_deserialize
My expectation is that because add_source is added sequentially, the parsing before a layer fails will still work. This way it won't be possible for one misconfiguration to cause the whole application to fall back to the default configuration on startup, which can cause huge failures. Still, config-rs does not deal with this problem, and it is up to the user to fall back on the importance if necessary.
The text was updated successfully, but these errors were encountered:
If I add 2-3 sources like code.
This code, which returns ConfigError。so,I can't
try_deserialize
My expectation is that because add_source is added sequentially, the parsing before a layer fails will still work. This way it won't be possible for one misconfiguration to cause the whole application to fall back to the default configuration on startup, which can cause huge failures. Still, config-rs does not deal with this problem, and it is up to the user to fall back on the importance if necessary.
The text was updated successfully, but these errors were encountered: