From 28ba4b5081bba81c361f77d39c8a7a33bc341dc1 Mon Sep 17 00:00:00 2001 From: "dorian.hodin" Date: Mon, 6 Mar 2023 13:58:01 +0100 Subject: [PATCH] Connection working, change message generate by PDOError.php and removing useless echo --- Source/API/script/Config/ConnectClass.php | 1 - Source/API/script/ExceptionHandle/PDOError.php | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/API/script/Config/ConnectClass.php b/Source/API/script/Config/ConnectClass.php index feaa2b9..440d095 100644 --- a/Source/API/script/Config/ConnectClass.php +++ b/Source/API/script/Config/ConnectClass.php @@ -21,7 +21,6 @@ class ConnectClass{ function connect(): int|Connection { try { - echo $this->dsn." ".$this->login." ".$this->password; $connection = new Connection($this->dsn,$this->login,$this->password); }catch (PDOException $e){ throw new PDOException($e->getMessage(), $e->getCode(), $e); diff --git a/Source/API/script/ExceptionHandle/PDOError.php b/Source/API/script/ExceptionHandle/PDOError.php index 63a9b79..4f70b5f 100644 --- a/Source/API/script/ExceptionHandle/PDOError.php +++ b/Source/API/script/ExceptionHandle/PDOError.php @@ -9,11 +9,11 @@ use Throwable; class PDOError extends HttpSpecializedException { protected $code = 408; - protected string $title = "PDO connection failed"; + protected string $title = "PDO Exception thrown in API"; public function __construct(ServerRequestInterface $request,string $message, ?Throwable $previous = null) { - parent::__construct($request, $message,$previous); + parent::__construct($request, $message, $previous); } } \ No newline at end of file