sub connect { my $dbh = DBI->connect( $dsn, $user, $passwd, {PrintError => 0} ) or Exception::Database->throw($DBI::errstr); $dbh->{HandleError} = sub { Exception::Database->throw($_[0]) }; return $dbh; }