-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
The comment https://github.com/Nebo15/confex/blob/master/lib/confex.ex#L314 says that ArgumentError is raised when configuration cannot be resolved. This however is not true.
Here you can see the configuration:
iex(1)> {:ok, c} = Application.fetch_env(:transporter, Transporter.ProxyRequests.Process)
{:ok,
[
bypass: %{
~r/\/\/client-logger\..*/ => %{
host: {:system, "CLIENT_LOGGER_SERVICE_HOST"},
port: 80,
scheme: "http"
}
}
]}
CLIENT_LOGGER_SERVICE_HOST env var is not actually set.
If I use use Confex, otp_app: :transporter
macro, then Transporter.ProxyRequests.Process.config()
returns just nil.
I think this is because Confex is using get_env https://github.com/Nebo15/confex/blob/master/lib/confex.ex#L319 which defaults to nil on error.
Feel free to close this ticket if this behavior is expected. It caused us a small incident because one of the env vars was missing and it didn't fail fast.
Metadata
Metadata
Assignees
Labels
No labels