Skip Menu |

This queue is for tickets about the Catalyst-Runtime CPAN distribution.

Report information
The Basics
Id: 61038
Status: resolved
Priority: 0/
Queue: Catalyst-Runtime

People
Owner: Nobody in particular
Requestors: perl [...] evancarroll.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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
The problem was __PACKAGE__->setup was never called in the MyApp.pm, maybe this should be detected and if ->setup isn't called the app shouldn't even attempt to do stuff. -- Evan Carroll System Lord of the Internets http://www.evancarroll.com
I'm rejecting this - ->setup is generated by the default skeleton and is documented as entirely necessary. We could add weird hooks to detect this condition at end of compilation, but I don't feel it's worth the effort or complexity