add try catch
This commit is contained in:
parent
c635846dba
commit
00973d4a14
1 changed files with 7 additions and 3 deletions
|
@ -91,9 +91,13 @@ $http->on('start', function (Server $http) use ($payloadSize, $register) {
|
||||||
/** @var array $collections */
|
/** @var array $collections */
|
||||||
$collections = Config::getParam('collections', []);
|
$collections = Config::getParam('collections', []);
|
||||||
|
|
||||||
|
try {
|
||||||
$redis->flushAll();
|
$redis->flushAll();
|
||||||
Console::success('[Setup] - Creating database: appwrite...');
|
Console::success('[Setup] - Creating database: appwrite...');
|
||||||
$dbForConsole->create(App::getEnv('_APP_DB_SCHEMA', 'appwrite'));
|
$dbForConsole->create(App::getEnv('_APP_DB_SCHEMA', 'appwrite'));
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Console::error('Failed to create database: ' . $e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
if ($dbForConsole->getCollection(Audit::COLLECTION)->isEmpty()) {
|
if ($dbForConsole->getCollection(Audit::COLLECTION)->isEmpty()) {
|
||||||
$audit = new Audit($dbForConsole);
|
$audit = new Audit($dbForConsole);
|
||||||
|
|
Loading…
Reference in a new issue