You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just helped @ranaldobowker debug an issue where a config file loaded by DaemonKit::Config was missing the correct environment name in the top-level of the YAML file, and subsequently blew up badly.
The offending lines in DaemonKit::Config#initialize tests for the presence of the DAEMON_ENV in the hash, and pulls that up one level.
Although this was probably amazing at the time, I think this magic is no longer good practice... We need to figure out how we can improve this and safeguard users from pulling out their hair...
My recommendation is to not have 2 ways (either by-env or top-level) ways of doing it, plus clear guidance when the user gets it wrong, rather than making them read/understand a stacktrace.
definitialize(config_data)#:nodoc:ifconfig_data.has_key?(DAEMON_ENV)self.data=config_data[DAEMON_ENV]elseraiseArgumentError,"Invalid config (missing key #{DAEMON_ENV.inspect}); " +
"please refer to user guide / wiki for further details"endend
Just helped @ranaldobowker debug an issue where a config file loaded by
DaemonKit::Config
was missing the correct environment name in the top-level of the YAML file, and subsequently blew up badly.The offending lines in DaemonKit::Config#initialize tests for the presence of the DAEMON_ENV in the hash, and pulls that up one level.
Although this was probably amazing at the time, I think this magic is no longer good practice... We need to figure out how we can improve this and safeguard users from pulling out their hair...
@marcbowes any ideas?
The text was updated successfully, but these errors were encountered: