I'm seeing an odd error popping up with the latest Moose that's killing most of
my tests. I'm using a custom error metaclass and am seeing the following:
t/Annotation/Reference.t .. 1/12
# Failed test 'use Biome::Annotation::Reference;'
# at t/Annotation/Reference.t line 8.
# Tried to use 'Biome::Annotation::Reference'.
# Error: The error metaclass for Biome::Annotation::Reference
(Biome::Root::Error) is not compatible with the error metaclass of its
superclass, Biome::Annotation::DBLink (Biome::Root::Error) at
/opt/perl512/lib/site_perl/5.12.1/darwin-thread-multi-2level/Class/MOP/Class.pm
line 277
...
This only happens (as one might guess from the error message) with classes that
inherit, but notice the two indicated error metaclasses match. Why is this
throwing an error? I'm declaring this in a common base metaclass as follows
(which worked up until now):
...
sub init_meta {
shift;
my $moose = Moose->init_meta(
@_,
base_class => 'Biome::Root',
metaclass => 'Biome::Meta::Class',
);
$moose->error_class($EXCEPTION_CLASS);
$moose;
}
Am I doing something wrong?
I also noticed a very similar problem when trying to install
MooseX::Error::Exception::Class, though in this case the error metaclasses
don't match:
Running Build test
t/000_load.t ............ 2/2 # Testing MooseX::Error::Exception::Class 0.099
t/000_load.t ............ ok
t/001_test.t ............ The error metaclass for TestPackage1
(MooseX::Error::Exception::Class) is not compatible with the error metaclass of
its superclass, Moose::Object (Moose::Error::Default) at
/opt/perl512/lib/site_perl/5.12.1/darwin-thread-multi-2level/Class/MOP/Class.pm
line 277
....
chris