[Catalyst] Propose: Make application abort loading when it encounters malformed config files

Jose Luis Martinez jlmartinez-lists-catalyst at capside.com
Thu Jun 11 10:22:47 GMT 2009


Hi,

    From time to time I keep stumbling upon this issue: when I malform 
the yaml config file for my app: the app loads up, and then strange 
things happen.

    My configs are normally parted between the MyApp.pm file, for things 
that the user will never configure, and the yaml config file, for things 
that the user will be able to customize.

    So just after touching a config file, if the app does something 
strange, I do a "cat xxx.yml | ysh" and find that

YAML Error: Invalid element in map
    Code: YAML_LOAD_ERR_BAD_MAP_ELEMENT
    Line: 28
    Document: 1
  at /usr/share/perl5/YAML.pm line 33

...oops...

    I think it would be nice to have ConfigLoader stop the loading of 
the app if it has come across a malformed config file. I've looked 
around the code, and don't know who to blame/patch, Config::Any or 
Catayst::Plugin::ConfigLoader.

Any tips?

Jose Luis Martinez
jlmartinez at capside.com



More information about the Catalyst mailing list