General cleanup of error messages - quote identifiers/names where sensible
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Relationship / Accessor.pm
index 174aa23..1609122 100644 (file)
@@ -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';