X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FAttribute.pm;h=c4b749e8fa7048e89e7b401d9dab5c8203df1023;hp=98dd81b1054f20c419295112de6f4c8c72fde3c6;hb=2a96ea8598dea995d57fa05e73cf2d42cf567e28;hpb=cbb8105898bb0faa7eee06ef890d2ec0c131dff7 diff --git a/lib/Mouse/Meta/Attribute.pm b/lib/Mouse/Meta/Attribute.pm index 98dd81b..c4b749e 100644 --- a/lib/Mouse/Meta/Attribute.pm +++ b/lib/Mouse/Meta/Attribute.pm @@ -238,13 +238,17 @@ sub verify_against_type_constraint { return 1 if !$type_constraint; return 1 if $type_constraint->check($value); - $self->verify_type_constraint_error($self->name, $value, $type_constraint); + $self->verify_type_constraint_error($value, $type_constraint); } sub verify_type_constraint_error { - my($self, $name, $value, $type) = @_; - $self->throw_error("Attribute ($name) does not pass the type constraint because: " - . $type->get_message($value)); + my($self, $value, $type) = @_; + + $self->throw_error( + sprintf q{Attribute (%s) does not pass the type constraint because: %s}, + $self->name, + $type->get_message($value), + ); } sub coerce_constraint { # DEPRECATED