Connection working, change message generate by PDOError.php and removing useless echo
continuous-integration/drone/push Build is passing Details

master
dorian.hodin 2 years ago
parent 85ae251770
commit 28ba4b5081

@ -21,7 +21,6 @@ class ConnectClass{
function connect(): int|Connection function connect(): int|Connection
{ {
try { try {
echo $this->dsn." ".$this->login." ".$this->password;
$connection = new Connection($this->dsn,$this->login,$this->password); $connection = new Connection($this->dsn,$this->login,$this->password);
}catch (PDOException $e){ }catch (PDOException $e){
throw new PDOException($e->getMessage(), $e->getCode(), $e); throw new PDOException($e->getMessage(), $e->getCode(), $e);

@ -9,11 +9,11 @@ use Throwable;
class PDOError extends HttpSpecializedException { class PDOError extends HttpSpecializedException {
protected $code = 408; 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) public function __construct(ServerRequestInterface $request,string $message, ?Throwable $previous = null)
{ {
parent::__construct($request, $message,$previous); parent::__construct($request, $message, $previous);
} }
} }
Loading…
Cancel
Save