]> ruin.nu Git - ND.git/commitdiff
Use RaiseError as default, since I ended up with 'or die' everywhere
authorMichael Andreen <harv@ruin.nu>
Thu, 19 Jun 2008 21:02:33 +0000 (23:02 +0200)
committerMichael Andreen <harv@ruin.nu>
Thu, 19 Jun 2008 21:02:33 +0000 (23:02 +0200)
DB.pm

diff --git a/DB.pm b/DB.pm
index 76cb9dd7773390112df42fabc26f7b52573afc49..43979d852fcca08fb0f9320646a810f247477e93 100644 (file)
--- a/DB.pm
+++ b/DB.pm
@@ -11,7 +11,7 @@ our @EXPORT = qw/DB/;
 
 sub DB {
        #Use domain sockets by default
 
 sub DB {
        #Use domain sockets by default
-       my $dbh = DBI->connect_cached("dbi:Pg:dbname=ndawn", "ndawn", "", {AutoCommit => 1});
+       my $dbh = DBI->connect_cached("dbi:Pg:dbname=ndawn", "ndawn", "", {AutoCommit => 1, RaiseError => 1});
        #Easy to also use /etc/postgresql/pg_services.conf
        #my $dbh =  DBI->connect_cached("dbi:Pg:service=ndawn","", "", {AutoCommit => 1});
        $dbh->rollback if $dbh->{Executed} || !$dbh->{AutoCommit};
        #Easy to also use /etc/postgresql/pg_services.conf
        #my $dbh =  DBI->connect_cached("dbi:Pg:service=ndawn","", "", {AutoCommit => 1});
        $dbh->rollback if $dbh->{Executed} || !$dbh->{AutoCommit};