From: Jakub Vrana Date: Fri, 20 Dec 2013 23:37:39 +0000 (-0800) Subject: Handle exception when creating SQLite database X-Git-Tag: v4.0.0~21 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=3d0605a8e76c2320839d1fa9978ad316ae246fcc;p=adminer.git Handle exception when creating SQLite database --- diff --git a/adminer/drivers/sqlite.inc.php b/adminer/drivers/sqlite.inc.php index 51ccf2b1..99867d29 100644 --- a/adminer/drivers/sqlite.inc.php +++ b/adminer/drivers/sqlite.inc.php @@ -422,7 +422,12 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) { if (!check_sqlite_name($db)) { return false; } - $link = new Min_SQLite($db); //! exception handler + try { + $link = new Min_SQLite($db); + } catch (Exception $ex) { + $connection->error = $ex->getMessage(); + return false; + } $link->query('PRAGMA encoding = "UTF-8"'); $link->query('CREATE TABLE adminer (i)'); // otherwise creates empty file $link->query('DROP TABLE adminer');