From b2c69284c7fddc4c11587bca2e56fed73cfc3c82 Mon Sep 17 00:00:00 2001 From: "dorian.hodin" Date: Mon, 6 Mar 2023 14:14:36 +0100 Subject: [PATCH] Try to make API work again 2 --- Source/API/script/Config/ConnectClass.php | 1 + Source/API/script/ExceptionHandle/PDOError.php | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/API/script/Config/ConnectClass.php b/Source/API/script/Config/ConnectClass.php index 440d095..feaa2b9 100644 --- a/Source/API/script/Config/ConnectClass.php +++ b/Source/API/script/Config/ConnectClass.php @@ -21,6 +21,7 @@ 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 4421ac4..09362ba 100644 --- a/Source/API/script/ExceptionHandle/PDOError.php +++ b/Source/API/script/ExceptionHandle/PDOError.php @@ -9,12 +9,11 @@ use Throwable; class PDOError extends HttpSpecializedException { protected $code = 408; - protected string $title = "PDO Exception connection failed"; + protected string $title = "PDO connection failed"; - public function __construct(ServerRequestInterface $request,string $message, ?Throwable $previous = null) + public function __construct(ServerRequestInterface $request,string $message,Throwable $previous) { - $this->message = $message; - parent::__construct($request, $previous); + parent::__construct($request,$message,$previous); } } \ No newline at end of file