Handle exception when creating SQLite database
This commit is contained in:
parent
17c8dea525
commit
3d0605a8e7
|
@ -422,7 +422,12 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
||||||
if (!check_sqlite_name($db)) {
|
if (!check_sqlite_name($db)) {
|
||||||
return false;
|
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('PRAGMA encoding = "UTF-8"');
|
||||||
$link->query('CREATE TABLE adminer (i)'); // otherwise creates empty file
|
$link->query('CREATE TABLE adminer (i)'); // otherwise creates empty file
|
||||||
$link->query('DROP TABLE adminer');
|
$link->query('DROP TABLE adminer');
|
||||||
|
|
Loading…
Reference in a new issue