summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/db.php b/db.php
index ad74639..e5c924c 100644
--- a/db.php
+++ b/db.php
@@ -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;');
}