X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FRelationship%2FAccessor.pm;fp=lib%2FDBIx%2FClass%2FRelationship%2FAccessor.pm;h=1609122fd03813a1f3320913a9f447481c627f44;hb=e705f5290cf384194c31a807c9bb722c7a167dfd;hp=174aa232e2592649b6ab212fc9f31f07ee2e94d7;hpb=4ca1fd6fb90a85f5138d11f580394025aa20ea4a;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Relationship/Accessor.pm b/lib/DBIx/Class/Relationship/Accessor.pm index 174aa23..1609122 100644 --- a/lib/DBIx/Class/Relationship/Accessor.pm +++ b/lib/DBIx/Class/Relationship/Accessor.pm @@ -45,7 +45,7 @@ sub add_relationship_accessor { } }; } elsif ($acc_type eq 'filter') { - $class->throw_exception("No such column $rel to filter") + $class->throw_exception("No such column '$rel' to filter") unless $class->has_column($rel); my $f_class = $class->relationship_info($rel)->{class}; $class->inflate_column($rel, @@ -55,7 +55,7 @@ sub add_relationship_accessor { }, deflate => sub { my ($val, $self) = @_; - $self->throw_exception("$val isn't a $f_class") unless $val->isa($f_class); + $self->throw_exception("'$val' isn't a $f_class") unless $val->isa($f_class); return ($val->_ident_values)[0]; # WARNING: probably breaks for multi-pri sometimes. FIXME } @@ -66,7 +66,7 @@ sub add_relationship_accessor { $meth{"${rel}_rs"} = sub { shift->search_related_rs($rel, @_) }; $meth{"add_to_${rel}"} = sub { shift->create_related($rel, @_); }; } else { - $class->throw_exception("No such relationship accessor type $acc_type"); + $class->throw_exception("No such relationship accessor type '$acc_type'"); } { no strict 'refs';