From f836683a9c514164fdf0c405272c634e79f1ba0a Mon Sep 17 00:00:00 2001 From: Max Pozdeev Date: Sat, 29 Jun 2019 18:47:06 +0300 Subject: [PATCH] more info on sqlite query error --- src/class.db.sqlite3.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/class.db.sqlite3.php b/src/class.db.sqlite3.php index f6a8acc..f2572ce 100644 --- a/src/class.db.sqlite3.php +++ b/src/class.db.sqlite3.php @@ -22,7 +22,7 @@ class DatabaseResult_Sqlite3 $r = $this->parent->dbh->exec($query); if($r === false) { $ei = $this->parent->dbh->errorInfo(); - throw new Exception($ei[2]); + throw new Exception("SQLSTATE[$ei[0]] [$ei[1]] $ei[2]"); } $this->parent->affected = $r; } @@ -31,7 +31,7 @@ class DatabaseResult_Sqlite3 $this->q = $this->parent->dbh->query($query); if(!$this->q) { $ei = $this->parent->dbh->errorInfo(); - throw new Exception($ei[2]); + throw new Exception("SQLSTATE[$ei[0]] [$ei[1]] $ei[2]"); } $this->parent->affected = $this->q->rowCount(); }