From 3f02668047e8632e835a326d19da975ba605b5bb Mon Sep 17 00:00:00 2001 From: RundelhausCode Date: Tue, 6 Apr 2021 12:24:45 +0200 Subject: [PATCH] error update --- Backend/setup.php | 7 +++---- bootstrap.php | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Backend/setup.php b/Backend/setup.php index 46ff1f5..b99f69e 100644 --- a/Backend/setup.php +++ b/Backend/setup.php @@ -85,13 +85,12 @@ if(isset($_POST["dbSetup"])){ file_put_contents($conFilePath, json_encode($dbCon)); - require_once('../bootstrap.php'); try{ - $capsule->Connection()->getPdo(); + require_once('../bootstrap.php'); } catch (\Exception $e) { - http_response_code(400); file_put_contents($conFilePath, NULL); - echo json_encode(["message" => "Could not connect to the database. Please check your configuration. error:"]); + http_response_code(400); + echo json_encode(["message" => "Could not connect to the database. Please check your configuration. error:" . $e]); exit(); } require_once ('Database/databaseMigration.php'); diff --git a/bootstrap.php b/bootstrap.php index 1959089..b988801 100755 --- a/bootstrap.php +++ b/bootstrap.php @@ -6,3 +6,4 @@ $con = json_decode(file_get_contents('config/database.json', true), true); $capsule->addConnection($con); $capsule->setAsGlobal(); $capsule->bootEloquent(); +$capsule->Connection()->getPdo();