smithfarm/cell

Unreasonable error message when config param has illegal value

Closed this issue · 3 comments

Now that we are using Params::Validate in App::CELL::Load::_conf_from_config, the error message that happens when an illegal value is assigned to a configuration parameter is unacceptable:

[Thu Jul 30 10:50:05 2015] ERR: CELL_CONFIG_LOAD_FAIL on file 
/usr/lib/perl5/site_perl/5.20.1/auto/share/dist/App-Dochazka-REST/REST_Config.pm 
with error message: The 'Value' parameter (undef) to 
App::CELL::Load::_conf_from_config was an 'undef', which is not one of the allowed 
types: scalar arrayref hashref coderef scalarref --  at 
/usr/lib/perl5/site_perl/5.20.1/App/CELL/Load.pm line 799. -- 
App::CELL::Load::_conf_from_config(undef, "Dest", App::CELL::Config=HASH(0xe8c458), 
"Param", "DOCHAZKA_INTERVAL_SELECT_LIMIT", "Value", undef, "File", 
"/usr/lib/perl5/site_perl/5.20.1/auto/share/dist/App-Dochazka-"..., ...) called at 
/usr/lib/perl5/site_perl/5.20.1/App/CELL/Load.pm line 754 -- 
App::CELL::Load::__ANON__("DOCHAZKA_INTERVAL_SELECT_LIMIT", undef) 
called at /usr/lib/perl5/site_perl/5.20.1/auto/share/dist/App-Dochazka-REST/REST_Config.pm 
line 232 -- 
require /usr/lib/perl5/site_perl/5.20.1/auto/share/dist/App-Dochazka-REST/REST_Config.pm 
called at /usr/lib/perl5/site_perl/5.20.1/App/CELL/Load.pm line 762

Needs a test case.

This particular issue (undef value triggering ugly message) was fixed by 0f15f9b

I'm not sure if it's possible to supply an illegal value now...