Do not rely on `Mix.env`
gaynetdinov opened this issue · comments
Since Mix
is not(and should not) included to a release, executing this command inside a release:
Application.get_env(:airbrakex, :environment, Mix.env)
causes an exception like this:
** (exit) an exception was raised:
** (UndefinedFunctionError) undefined function Mix.env/0 (module Mix is not available)
Mix.env()
You can either make environment
param mandatory and remove default
value(which is Mix.env
) from get_env
function call OR you can merge this PR #9. To be honest I don't know which option is better, probably the first one.
Making 'environment' param mandatory may brake your app after upgrade. #9 soultion is fine, and as you said it works on production without mix
. Could you rename @env
to @default_env
?
Merged! THanks!