-
-
Notifications
You must be signed in to change notification settings - Fork 232
Description
Thank you for implementing config.extra_sources in PR #366 ! I personally had a monkey patch in place to achieve similar functionality, and this new feature allowed me to remove it entirely, which is fantastic.
Currently, if a file specified in config.extra_sources does not exist, it is silently skipped. For example, the following code:
Config.setup do |config|
config.extra_sources = ['does_not_exists.yml']
end
will not raise an error. This behavior appears to stem from the implementation around
config/lib/config/sources/yaml_source.rb
Line 17 in 5e192a5
| if @path and File.exist?(@path) |
Expected Behavior / Feature Request:
I propose adding an option to make Config raise an error (e.g., FileNotFoundError or a custom Config::Error) when a file listed in config.extra_sources does not exist.
The current silent failure can make it difficult to identify misconfigurations or typos in file paths. Explicitly raising an error would provide immediate feedback, aiding in debugging and ensuring that all intended configuration sources are loaded.
Thanks!