diff options
author | Patrick Webster <noxwizard@phpbb.com> | 2014-07-03 13:05:54 -0500 |
---|---|---|
committer | Patrick Webster <noxwizard@gmail.com> | 2014-07-03 13:05:54 -0500 |
commit | 3ca708edadce1c82903559f384fd15638d0ab2de (patch) | |
tree | d30ef8b173e443b5448368da2cfcb9ec46e6e2b0 /phpBB/phpbb/db/driver/sqlite3.php | |
parent | ad11925c7730e4f3c6b1cffe46c6ba531f04f4d9 (diff) | |
download | forums-3ca708edadce1c82903559f384fd15638d0ab2de.tar forums-3ca708edadce1c82903559f384fd15638d0ab2de.tar.gz forums-3ca708edadce1c82903559f384fd15638d0ab2de.tar.bz2 forums-3ca708edadce1c82903559f384fd15638d0ab2de.tar.xz forums-3ca708edadce1c82903559f384fd15638d0ab2de.zip |
[ticket/12802] Properly handle connection failures in SQLite3
PHPBB3-12802
Diffstat (limited to 'phpBB/phpbb/db/driver/sqlite3.php')
-rw-r--r-- | phpBB/phpbb/db/driver/sqlite3.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/phpBB/phpbb/db/driver/sqlite3.php b/phpBB/phpbb/db/driver/sqlite3.php index 2c6bf99497..36d8a83f4b 100644 --- a/phpBB/phpbb/db/driver/sqlite3.php +++ b/phpBB/phpbb/db/driver/sqlite3.php @@ -50,9 +50,10 @@ class sqlite3 extends \phpbb\db\driver\driver $this->dbo = new \SQLite3($this->server, SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE); $this->db_connect_id = true; } - catch (Exception $e) + catch (\Exception $e) { - return array('message' => $e->getMessage()); + $this->connect_error = $e->getMessage(); + return array('message' => $this->connect_error); } return true; @@ -272,7 +273,7 @@ class sqlite3 extends \phpbb\db\driver\driver */ protected function _sql_error() { - if (class_exists('SQLite3', false)) + if (class_exists('SQLite3', false) && isset($this->dbo)) { $error = array( 'message' => $this->dbo->lastErrorMsg(), |