From 57a229e307782632dd205961a611184a716deefe Mon Sep 17 00:00:00 2001 From: "dorian.hodin" Date: Mon, 6 Mar 2023 10:06:37 +0100 Subject: [PATCH] Try to add echo to see where is the problem --- Source/API/script/Config/ConnectClass.php | 2 +- Source/API/script/Gateway/GatewayForm.php | 3 ++- Source/API/script/index.php | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/API/script/Config/ConnectClass.php b/Source/API/script/Config/ConnectClass.php index f1865f7..ad054dc 100644 --- a/Source/API/script/Config/ConnectClass.php +++ b/Source/API/script/Config/ConnectClass.php @@ -21,7 +21,7 @@ class ConnectClass{ function connect(): int|Connection { try { - + echo "OKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK"; $connection = new Connection($this->dsn,$this->login,$this->password); }catch (PDOException){ diff --git a/Source/API/script/Gateway/GatewayForm.php b/Source/API/script/Gateway/GatewayForm.php index 10ae8e3..def3f1c 100644 --- a/Source/API/script/Gateway/GatewayForm.php +++ b/Source/API/script/Gateway/GatewayForm.php @@ -14,8 +14,9 @@ class GatewayForm public function __construct() { try{ + echo "ici???"; $this->connection = (new ConnectClass)->connect(); - }catch(PDOException $e){ + }catch(PDOException){ throw new PDOException(); } } diff --git a/Source/API/script/index.php b/Source/API/script/index.php index 4852b0c..7decb27 100644 --- a/Source/API/script/index.php +++ b/Source/API/script/index.php @@ -46,7 +46,8 @@ $app->get('/', function (Request $request, Response $response) { $ok = true; $response->getBody()->write(json_encode((new $gateway)->$method($parameters))); } - }catch (PDOException $e){ + }catch (PDOException){ + echo "ici?"; throw new PDOError($request); } }