summaryrefslogtreecommitdiff
path: root/db.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-01-19 16:54:35 +0300
committerAndrew Dolgov <[email protected]>2021-01-19 16:54:35 +0300
commitd8cf8e1bd42338bff1f3d5a75cab6c715128e260 (patch)
treec19079f66c422fe5bb3bdbd0a0f8b6a3a1a4d203 /db.php
parent31d1e8fefd86f8f9e1b91032726ea169950ff1c7 (diff)
pdo: report errors via exceptions
Diffstat (limited to 'db.php')
-rw-r--r--db.php1
1 files changed, 1 insertions, 0 deletions
diff --git a/db.php b/db.php
index e5c924c..6e28a91 100644
--- a/db.php
+++ b/db.php
@@ -10,6 +10,7 @@ class Db {
die("Unable to initialize database driver (SQLite): $e");
}
//$this->dbh->busyTimeout(30*1000);
+ $this->dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$this->dbh->query('PRAGMA journal_mode = wal;');
}