[Dbix-class] Error messages are sometimes cryptic

Michele Beltrame mb at italpro.net
Mon Mar 20 16:03:27 CET 2006


Hello!

Moving a Catalyst DBIx::Class based from a PC to another, I encountered
an error which was caused by a missing module. However, it took however
me forever to understand that, because DBIx::Class was giving me this error:

-----
Couldn't instantiate component "Aintra::M::Dbs", "Cannot load schema
class 'Aintra::M::Dbs::Schema': Can't locate object method
"result_source_instance" via package "Aintra::M::Dbs::Schema::Calendar"
at /usr/lib/perl5/vendor_perl/5.8.7/DBIx/Class/Schema.pm line 70.
Compilation failed in require at
/usr/lib/perl5/vendor_perl/5.8.7/Catalyst/Model/DBIC/Schema.pm line 167.
-----

The problem was that Aintra::M::Dbs::Schema::Calendar contained a:

-----
use Aintra::Util;
for my $field ( qw/ibegin iend/ ) {
    __PACKAGE__->inflate_column($field, {
        inflate     => sub { Aintra::Util::time_db2obj(shift) },
        deflate     => sub { Aintra::Util::time_obj2db(shift) },
    });
}
-----

and my package Aintra::Util pulls in DateTime::Format::Strptime which
was not installed on my system. However, the error message was (at
glance) completely unrelated with that.

I don't know exactly if this problem is Catalyst-related or
DBIx::Class-related, but I suspect the second and so I posted in this
mailing list. Maybe the error messages can be made somehow clearer... ;-)

Thanks,
Michele.

-- 
Michele Beltrame
http://www.varlogarthas.net/
ICQ# 76660101
Informativa privacy: http://www.italpro.net/em.html



More information about the Dbix-class mailing list