From: Dave Rolsky Date: Thu, 18 Sep 2008 15:06:57 +0000 (+0000) Subject: Document error_class attribute. X-Git-Tag: 0.58~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8b1d510fd5c3d348d11dcbe07f313f43e4ac647f;p=gitmo%2FMoose.git Document error_class attribute. Tweaked the metaclass reconciliation bits to account for error_class. --- diff --git a/lib/Moose/Meta/Class.pm b/lib/Moose/Meta/Class.pm index d518d16..9975650 100644 --- a/lib/Moose/Meta/Class.pm +++ b/lib/Moose/Meta/Class.pm @@ -8,7 +8,7 @@ use Class::MOP; use Carp (); use List::Util qw( first ); -use List::MoreUtils qw( any all ); +use List::MoreUtils qw( any all uniq ); use Scalar::Util 'weaken', 'blessed'; our $VERSION = '0.57'; @@ -350,7 +350,8 @@ sub _superclass_meta_is_compatible { # I don't want to have to type this >1 time my @MetaClassTypes = - qw( attribute_metaclass method_metaclass instance_metaclass constructor_class destructor_class ); + qw( attribute_metaclass method_metaclass instance_metaclass + constructor_class destructor_class error_class ); sub _reconcile_with_superclass_meta { my ($self, $super) = @_; @@ -385,7 +386,8 @@ sub _reinitialize_with { instance_metaclass => $new_meta->instance_metaclass, ); - $new_self->$_( $new_meta->$_ ) for qw( constructor_class destructor_class ); + $new_self->$_( $new_meta->$_ ) + for qw( constructor_class destructor_class error_class ); %$self = %$new_self; @@ -515,7 +517,7 @@ sub _all_roles_until { push @roles, $meta->calculate_all_roles; } - return @roles; + return uniq @roles; } sub _reconcile_role_differences { @@ -810,6 +812,12 @@ immutable. These default to L and L respectively. These accessors are read-write, so you can use them to change the class name. +=item B + +The name of the class used to throw errors. This default to +L, which generates an error with a stacktrace +just like C. + =item B Moose overrides this method from C and attempts to