Subject: | Catalyst assumes there is a $c->log to call error method on (or dies silently). |
I'm messing with Cataylst::Test, and for the life of me I can't get it
to work: I keep getting: "t/coo.t .. Can't call method "error" on an
undefined value at /usr/local/share/perl/5.10.1/Catalyst.pm line 1938."
I checked out "/usr/local/share/perl/5.10.1/Catalyst.pm" and I found
if ( my $error = $@ ) {
chomp $error;
$class->log->error(qq/Caught exception in engine "$error"/);
}
I'm not sure why my class doesn't have a `log` object but that should
probably not render such an ugly exception. Maybe explain that $class is
not set up or something. Or, just even die revealing $error.
$class->can('log')
? $class->log->error(qq/Caught exception in engine "$error"/)
: die $error
;
And, I get:
t/coo.t .. Can't locate object method "new" via package
"Catalyst::Stats" (perhaps you forgot to load "Catalyst::Stats"?) at
/usr/local/share/perl/5.10.1/Catalyst.pm line 1972. at
/usr/local/share/perl/5.10.1/Catalyst.pm line 1938.
Now, that I know what my problem is, I need to find out why I don't have
Catalyst::Stats...
--
Evan Carroll
System Lord of the Internets
http://www.evancarroll.com