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

No default and nil as default aren't the same #49

Open
janpieper opened this issue Mar 17, 2020 · 1 comment
Open

No default and nil as default aren't the same #49

janpieper opened this issue Mar 17, 2020 · 1 comment

Comments

@janpieper
Copy link

Maybe I am wrong, but this doesn't feel to be the truth:

* `{:system, :integer, "ENV_NAME"}` - same as `{:system, :integer, "ENV_NAME", nil}`;

For me, I get an ArgumentError when using {:system, :integer, "ENV_NAME"}:

** (Mix) Could not start application example: exited in: Example.Application.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (ArgumentError) can't fetch value for key `Example.Config` of application `:example`, can not resolve key ENV_NAME value via adapter Elixir.Confex.Adapters.SystemEnvironment

But it works fine when using {:system, :integer, "ENV_NAME", nil}. So, it is not the same.

@AndrewDryga
Copy link
Member

@janpieper good catch, feel free to send a PR to fix the documentation. It should raise indeed because often if you don't have defaults you won't want to end up loading invalid configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants