[Bast-commits] r3448 -
branches/DBIx-Class-current/lib/DBIx/Class/Storage
blblack at dev.catalyst.perl.org
blblack at dev.catalyst.perl.org
Thu May 31 20:22:39 GMT 2007
Author: blblack
Date: 2007-05-31 20:22:37 +0100 (Thu, 31 May 2007)
New Revision: 3448
Modified:
branches/DBIx-Class-current/lib/DBIx/Class/Storage/DBI.pm
Log:
_execute throws execptions as opposed to returning undef, so check errors that way
Modified: branches/DBIx-Class-current/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- branches/DBIx-Class-current/lib/DBIx/Class/Storage/DBI.pm 2007-05-31 17:55:12 UTC (rev 3447)
+++ branches/DBIx-Class-current/lib/DBIx/Class/Storage/DBI.pm 2007-05-31 19:22:37 UTC (rev 3448)
@@ -913,11 +913,13 @@
my $ident = $source->from;
my $bind_attributes = $self->source_bind_attributes($source);
+ eval { $self->_execute('insert' => [], $source, $bind_attributes, $to_insert) };
$self->throw_exception(
"Couldn't insert ".join(', ',
map "$_ => $to_insert->{$_}", keys %$to_insert
- )." into ${ident}"
- ) unless ($self->_execute('insert' => [], $source, $bind_attributes, $to_insert));
+ )." into ${ident}: $@"
+ ) if $@;
+
return $to_insert;
}
More information about the Bast-commits
mailing list