diff options
author | Joas Schilling <coding@schilljs.com> | 2020-02-05 11:00:37 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-02-05 13:55:17 +0100 |
commit | fca8f061abeaca295c76440c99b363f15c265d5b (patch) | |
tree | 5ae7162054157c11ec15e7dd1e99c6b0c34552dd /lib/private/Setup.php | |
parent | ac89b6abe71b7cea07413aa796f468c4df7eb16c (diff) | |
download | nextcloud-server-fca8f061abeaca295c76440c99b363f15c265d5b.tar.gz nextcloud-server-fca8f061abeaca295c76440c99b363f15c265d5b.zip |
Split the exception handling so install errors don't log as setup errors
More gebuging
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Setup.php')
-rw-r--r-- | lib/private/Setup.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/private/Setup.php b/lib/private/Setup.php index a44b0fd488f..acd75b88fb9 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -353,11 +353,9 @@ class Setup { $this->config->setValues($newConfigValues); + $dbSetup->initialize($options); try { - $dbSetup->initialize($options); $dbSetup->setupDatabase($username); - // apply necessary migrations - $dbSetup->runMigrations(); } catch (\OC\DatabaseSetupException $e) { $error[] = [ 'error' => $e->getMessage(), @@ -371,6 +369,16 @@ class Setup { ]; return $error; } + try { + // apply necessary migrations + $dbSetup->runMigrations(); + } catch (Exception $e) { + $error[] = [ + 'error' => 'Error while trying to initialise the database: ' . $e->getMessage(), + 'hint' => '', + ]; + return $error; + } //create the user and group $user = null; |