From: Will Hawes Date: Mon, 6 Mar 2006 16:34:42 +0000 (+0000) Subject: throw error including SQL statement for failed $sth->execute X-Git-Tag: v0.06000~60^2~62 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fbd466a29a3f5c3a9eeb2ba3691d675ee6388e47;p=dbsrgits%2FDBIx-Class.git throw error including SQL statement for failed $sth->execute --- diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 015fa3e..e733b53 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -436,7 +436,7 @@ sub _execute { @bind = map { ref $_ ? ''.$_ : $_ } @bind; # stringify args my $rv; if ($sth) { - $rv = $sth->execute(@bind); + $rv = $sth->execute(@bind) or $self->throw_exception("Error executing '$sql': " . $sth->errstr); } else { $self->throw_exception("'$sql' did not generate a statement."); }