diff options
author | Joas Schilling <coding@schilljs.com> | 2020-02-05 13:00:37 +0300 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-04-14 12:02:14 +0300 |
commit | 6e892c0db6613360a43fa5e98832b41761a32bec (patch) | |
tree | af01cca52088557c8c3e2eddae8f85732ea1d2db | |
parent | b48daab7311065acb9f49e8544628d23535641c6 (diff) |
Split the exception handling so install errors don't log as setup errors
More gebuging
Signed-off-by: Joas Schilling <coding@schilljs.com>
-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 5b2f71e69c5..89bc82abd05 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -343,11 +343,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(), @@ -361,6 +359,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; |