sub throw_exception {
my $self=shift;
- if (ref $self && ref $self->result_source) {
+ if (ref $self && ref $self->result_source && $self->result_source->schema) {
$self->result_source->schema->throw_exception(@_);
} else {
croak(@_);
while (my ($insert_trigger) = $sth->fetchrow_array) {
return uc($1) if $insert_trigger =~ m!(\w+)\.nextval!i; # col name goes here???
}
- croak "Unable to find a sequence INSERT trigger on table '" . $source->name . "'.";
+ $self->throw_exception("Unable to find a sequence INSERT trigger on table '" . $source->name . "'.");
}
=head2 get_autoinc_seq