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
MONGOID-5099 Improve error when loading an empty or invalid config file (#5032)
* Fixes MONGOID-5099
Improves error when loading an empty or invalid file and adds specs to #load_yaml method. Note that certain errors (file missing, ERB, YAML parsing) bubble up as per existing behavior.
This change is only intended to avoid an internal cryptic error happening within Mongoid's code (NoMethodError (undefined method `[]' for false:FalseClass). Please also note that this does not change the conditions under which an exception occurs, it just changes the class of the exception.
* repair exception docstring
* fix test setup
* tweak exception message
* raise a specific exception for the case of empty config file
* exception constructors are private
* fix the test
Co-authored-by: shields <[email protected]>
Co-authored-by: Oleg Pudeyev <[email protected]>
0 commit comments