[Bast-commits] r7587 -
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Sun Sep 6 18:45:42 GMT 2009
Author: ribasushi
Date: 2009-09-06 18:45:41 +0000 (Sun, 06 Sep 2009)
New Revision: 7587
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/MSSQL.pm
Log:
Clearer MSSQL error message
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/MSSQL.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/MSSQL.pm 2009-09-06 18:35:30 UTC (rev 7586)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/MSSQL.pm 2009-09-06 18:45:41 UTC (rev 7587)
@@ -16,10 +16,20 @@
sub _set_identity_insert {
my ($self, $table) = @_;
- $self->_get_dbh->do (sprintf
+
+ my $sql = sprintf (
'SET IDENTITY_INSERT %s ON',
- $self->sql_maker->_quote ($table)
+ $self->sql_maker->_quote ($table),
);
+
+ my $dbh = $self->_get_dbh;
+ eval { $dbh->do ($sql) };
+ if ($@) {
+ $self->throw_exception (sprintf "Error executing '%s': %s",
+ $sql,
+ $dbh->errstr,
+ );
+ }
}
sub insert_bulk {
More information about the Bast-commits
mailing list