Merged patched from andyg to throw useful errors during relationship loading
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Relationship / Base.pm
index b1d11a7..4590985 100644 (file)
@@ -3,7 +3,7 @@ package DBIx::Class::Relationship::Base;
 use strict;
 use warnings;
 
-use base qw/Class::Data::Inheritable/;
+use base qw/DBIx::Class/;
 
 __PACKAGE__->mk_classdata('_relationships', { } );
 
@@ -43,6 +43,9 @@ sub add_relationship {
   die "Can't create relationship without join condition" unless $cond;
   $attrs ||= {};
   eval "require $f_class;";
+  if ($@) {
+    $class->throw($@) unless $@ =~ /Can't locate/;
+  }
   my %rels = %{ $class->_relationships };
   $rels{$rel} = { class => $f_class,
                   cond  => $cond,