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:
parent
2131c36eac
commit
5b35b73b56
1 changed files with 10 additions and 9 deletions
19
src/main.rs
19
src/main.rs
|
@ -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>()?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue