From: Brandon L. Black Date: Tue, 12 Jun 2007 07:46:50 +0000 (+0000) Subject: small throw_exception fixes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=66cab05c1e8ef4a12f19deca15791b45e5559905;p=dbsrgits%2FDBIx-Class-Historic.git small throw_exception fixes --- diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index a2d15c4..40e7ffa 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -674,7 +674,7 @@ See Schema's throw_exception. 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(@_); diff --git a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm index 4b1521d..eeade7f 100644 --- a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm +++ b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm @@ -56,7 +56,7 @@ sub _dbh_get_autoinc_seq { 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