diff options
author | Andrew Dolgov <[email protected]> | 2020-09-12 17:02:30 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2020-09-12 17:02:30 +0300 |
commit | 069489d437f66cded1ef97b18ae832f00b6cba82 (patch) | |
tree | 37752bbafa7997271b52e7e54c219acec4086b20 /db.php | |
parent | b09a0ed5d1861e0f291c2d76ed801556549e5588 (diff) |
crash with an error message if PDO sqlite driver is missing and/or unable to initialize it
Diffstat (limited to 'db.php')
-rw-r--r-- | db.php | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -4,7 +4,11 @@ class Db { private $dbh; private function __construct() { - $this->dbh = new PDO('sqlite:' . SCRATCH_DB); + try { + $this->dbh = new PDO('sqlite:' . SCRATCH_DB); + } catch (Exception $e) { + die("Unable to initialize database driver (SQLite): $e"); + } //$this->dbh->busyTimeout(30*1000); $this->dbh->query('PRAGMA journal_mode = wal;'); } |