- $s->{db} = DBI->connect($dsn,'','',{AutoCommit => 0,RaiseError=>1});
+ eval {
+ $s->{db} = DBI->connect($dsn,'','',{AutoCommit => 0,RaiseError=>1});
+ $s->log(4, "Can't connect to DB: $DBI::errstr") unless $s->{db};
+ };
+ if ($@) {
+ $s->log(4, "Can't connect to DB: $DBI::errstr");
+ die $@;
+ }
+ $s->log(4, "connected to $dsn");
+
+ # TODO abort if can't connect