Include the DBI error message if a deploy statement fails.
Dagfinn Ilmari Mannsåker [Wed, 30 May 2007 11:31:47 +0000 (11:31 +0000)]
lib/DBIx/Class/Storage/DBI.pm

index bc66144..1c43c71 100644 (file)
@@ -1125,7 +1125,7 @@ sub deploy {
       next if($_ =~ /^COMMIT/m);
       next if $_ =~ /^\s+$/; # skip whitespace only
       $self->debugobj->query_start($_) if $self->debug;
-      $self->dbh->do($_) or warn "SQL was:\n $_";
+      $self->dbh->do($_) or warn $self->dbh->errstr, "\nSQL was:\n $_";
       $self->debugobj->query_end($_) if $self->debug;
     }
   }