Split the exception handling so install errors don't log as setup errors

More gebuging

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2020-02-05 11:00:37 +01:00 committed by John Molakvoæ (skjnldsv)
parent b48daab731
commit 6e892c0db6
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF
1 changed files with 11 additions and 3 deletions

View File

@ -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;