X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FPK%2FAuto.pm;h=ff4ed69822185406b35543a1b03bd86fc4f8e5ef;hb=78bab9cad621ac5e3d1d12b02c41d662dec7a22a;hp=2436120df50c6d1dd2b26c4f2b4955602e97067f;hpb=2840de8fbf8506d2edbec5a9c7500136f0fc1c2a;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/PK/Auto.pm b/lib/DBIx/Class/PK/Auto.pm index 2436120..ff4ed69 100644 --- a/lib/DBIx/Class/PK/Auto.pm +++ b/lib/DBIx/Class/PK/Auto.pm @@ -32,13 +32,13 @@ sub insert { (grep { $self->_primaries->{$_}{'auto_increment'} } keys %{ $self->_primaries }) || (keys %{ $self->_primaries }); - die "More than one possible key found for auto-inc on ".ref $self + $self->throw( "More than one possible key found for auto-inc on ".ref $self ) if $too_many; unless (defined $self->get_column($pri)) { - die "Can't auto-inc for $pri on ".ref $self.": no _last_insert_id method" + $self->throw( "Can't auto-inc for $pri on ".ref $self.": no _last_insert_id method" ) unless $self->can('_last_insert_id'); my $id = $self->_last_insert_id; - die "Can't get last insert id" unless $id; + $self->throw( "Can't get last insert id" ) unless $id; $self->store_column($pri => $id); } return $ret;