From 5d69a0b13c6ddcb6a14f6640e796e1aa439c88fb Mon Sep 17 00:00:00 2001 From: "dorian.hodin" Date: Mon, 6 Mar 2023 13:45:44 +0100 Subject: [PATCH] Try to display PDO error message 2 --- Source/API/script/Config/ConnectClass.php | 5 +---- Source/API/script/Gateway/GatewayForm.php | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Source/API/script/Config/ConnectClass.php b/Source/API/script/Config/ConnectClass.php index 6fff745..8b397c1 100644 --- a/Source/API/script/Config/ConnectClass.php +++ b/Source/API/script/Config/ConnectClass.php @@ -23,10 +23,7 @@ class ConnectClass{ try { echo $this->dsn." ".$this->login." ".$this->password; $connection = new Connection($this->dsn,$this->login,$this->password); - sleep(3); - echo "\nOKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK\n"; - }catch (PDOException $e){ - echo $e->getMessage()." ET ".$e->getTraceAsString(); + }catch (PDOException){ throw new PDOException(); } return $connection; diff --git a/Source/API/script/Gateway/GatewayForm.php b/Source/API/script/Gateway/GatewayForm.php index d2c6a55..bce2212 100644 --- a/Source/API/script/Gateway/GatewayForm.php +++ b/Source/API/script/Gateway/GatewayForm.php @@ -15,8 +15,8 @@ class GatewayForm { try{ $this->connection = (new ConnectClass)->connect(); - echo "ici???"; - }catch(PDOException){ + }catch(PDOException $e){ + echo $e->getMessage()." ET ".$e->getTraceAsString(); throw new PDOException(); } }