error message for failed delegation should use the attribute name, not the delegate...
Jesse Luehrs [Sun, 8 Feb 2009 21:21:51 +0000 (21:21 +0000)]
lib/Moose/Meta/Method/Delegation.pm

index 05bf31d..c924060 100644 (file)
@@ -79,7 +79,7 @@ sub _initialize_body {
             || $self->throw_error(
             "Cannot delegate $handle_name to $method_to_call because "
                 . "the value of "
-                . $self->name
+                . $self->associated_attribute->name
                 . " is not defined",
             method_name => $method_to_call,
             object      => $instance