On 07/07/2010 05:16 AM, Mike Tonks wrote: > 1) So and so CPAN module is not found > > 2) Config file not found (ConfigAuto - in cgiapp_init) > > currently these produce an ugly 500 Server Error and loeave you > searching in the apache log for the problem. > > For 1) is there a better way than: > > use Data::Dumper; > use XML::Simple; > use Date::Manip; > use HTML::FromText;
It's verbose, but the only thing I know of is: BEGIN { eval { require Data::Dumper; Data::Dumper::import() }; die "Can't find Data::Dumper module: $@" if $@; } repeated for each one. > that will safely try to load the modules needed and allow me to report > via a nice formatted error page what's wrong? Btw, it's not a good idea to show detailed error messages on your website. It's a security concern as it gives out more information to attackers than necessary. So it's not a good idea to start. Error logs are your friend. Learn them and learn to love them. > 2) If I hit an error in cgiapp_init, is there a way to redirect to an > error page, as per prerun_mode() ? There doesn't appear to be. There's the error_mode() but that only seems to work for run modes, not other stages. -- Michael Peters Plus Three, LP ##### CGI::Application community mailing list ################ ## ## ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp ## ## ## ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ## ## ################################################################