enter link description here
What’s the special meaning for ending with ! for function name?
defp db_host do
Application.fetch_env!(:my_app, :db_host)
end
>Solution :
As explained in the Naming Convention section "Trailing Bang": https://hexdocs.pm/elixir/1.13.4/naming-conventions.html#trailing-bang-foo
A trailing bang (exclamation mark) signifies a function or macro where failure cases raise an exception.
So the function Application.fetch_env! will raise an ArgumentError when the configuration parameter does not exist (as stated in the documentation) while Application.fetch_env (without exclamation mark) will return an :error in case of a non-existing parameter