1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2025-06-27 16:35:59 +00:00

reword error message about CONDUIT_CONFIG

The new message more accurately reflects the purpose and behaviors of
the environment variable.
This commit is contained in:
Charles Hall 2024-04-19 14:31:24 -07:00 committed by Matthias Ahouansou
parent 2131c36eac
commit 5b35b73b56
No known key found for this signature in database

View file

@ -58,15 +58,16 @@ async fn try_main() -> Result<(), Box<dyn std::error::Error>> {
clap::parse();
// Initialize config
let raw_config =
Figment::new()
.merge(
Toml::file(Env::var("CONDUIT_CONFIG").ok_or(
"The CONDUIT_CONFIG env var needs to be set. Example: /etc/conduit.toml",
)?)
.nested(),
)
.merge(Env::prefixed("CONDUIT_").global());
let raw_config = Figment::new()
.merge(
Toml::file(Env::var("CONDUIT_CONFIG").ok_or(
"the `CONDUIT_CONFIG` environment variable must either be set to a \
configuration file path or set to the empty string to force configuration \
through environment variables",
)?)
.nested(),
)
.merge(Env::prefixed("CONDUIT_").global());
let config = raw_config.extract::<Config>()?;