Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config#Load(): Let error indicate absence of the default config file #112

Conversation

lippserd
Copy link
Member

@lippserd lippserd commented Mar 5, 2025

If the validation of the configuration fails, config#Load() currently only returns an error message about the failed validation. However, the default configuration file may be missing, which itself is not an error in the validation process, as config#Load() supports loading configurations from both YAML and environment variables. In order to obtain a meaningful error message, config#Load() now returns a combined error message indicating that the default configuration file is missing, which can be ignored if the configuration is supposed to be provided entirely via environment variables.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
If the validation of the configuration fails, `config#Load()` currently only
returns an error message about the failed validation. However, the default
configuration file may be missing, which itself is not an error in the
validation process, as `config#Load()` supports loading configurations from
both YAML and environment variables.  In order to obtain a meaningful error
message, `config#Load()` now returns a combined error message indicating that
the default configuration file is missing, which can be ignored if the
configuration is supposed to be provided entirely via environment variables.
@lippserd lippserd added this to the 0.6.0 milestone Mar 5, 2025
@cla-bot cla-bot bot added the cla/signed CLA is signed by all contributors of a PR label Mar 5, 2025
@lippserd lippserd requested a review from oxzi March 5, 2025 08:53
@lippserd lippserd merged commit f860775 into main Mar 20, 2025
15 checks passed
@lippserd lippserd deleted the config-load-error-message-if-config-file-is-default-and-does-not-exist branch March 20, 2025 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla/signed CLA is signed by all contributors of a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants