error message for failed delegation should use the attribute name, not the delegate...
[gitmo/Moose.git] / 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