]> source.dussan.org Git - nextcloud-server.git/commitdiff
Split the exception handling so install errors don't log as setup errors
authorJoas Schilling <coding@schilljs.com>
Wed, 5 Feb 2020 10:00:37 +0000 (11:00 +0100)
committerJoas Schilling <coding@schilljs.com>
Wed, 5 Feb 2020 12:55:17 +0000 (13:55 +0100)
More gebuging

Signed-off-by: Joas Schilling <coding@schilljs.com>
lib/private/Setup.php

index a44b0fd488f387b38c3aac6ab4e7d8e7d67b549a..acd75b88fb97532af5e9e9bc33ab0142f5372823 100644 (file)
@@ -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;