Closed nelsonic closed 4 years ago
Thinking of raising an error if the environment variables are undefined:
iex> raise ArgumentError, message: "Environment variables GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET undefined"
see: https://hexdocs.pm/elixir/Exception.html and: https://elixir-lang.org/getting-started/try-catch-and-rescue.html#errors
Alternatively the more succinct and fatal:
iex> exit("Environment variables GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET undefined")
** (exit) "Environment variables GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET undefined"
I want to figure out the appropriate way of doing Logging: https://github.com/dwyl/learn-elixir/issues/149
At present the /test/elixir_auth_github_test.exs
file has 28 mentions of the word "env" ...
Most of the tests include some reference to the "ENVIRONMENT VARIABLES NOT SET" ...
This feels unnecessarily repetitive ... 🤔
Resolved by #34 ✅
At present the
README.md
recommends using Environment Variables but it requires you to addconfig
settings to yourconfig.exs
:We could avoid the step and just inform people they must have
GITHUB_CLIENT_ID
andGITHUB_CLIENT_SECRET
defined in order for the package to work.