From d8cf8e1bd42338bff1f3d5a75cab6c715128e260 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 19 Jan 2021 16:54:35 +0300 Subject: pdo: report errors via exceptions --- db.php | 1 + 1 file changed, 1 insertion(+) (limited to 'db.php') 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;'); } -- cgit v1.2.3