1
0
Fork 0
mirror of synced 2024-06-28 19:20:25 +12:00

New connection should throw exceptions too

This commit is contained in:
Eldad Fux 2020-07-03 13:24:09 +03:00
parent 26e3b22f76
commit ed39069cc2

View file

@ -61,6 +61,12 @@ class PDO extends PDONative
public function reconnect()
{
return $this->pdo = new PDONative($this->dsn, $this->username, $this->passwd, $this->options);
$this->pdo = new PDONative($this->dsn, $this->username, $this->passwd, $this->options);
// Connection settings
$this->pdo->setAttribute(PDONative::ATTR_DEFAULT_FETCH_MODE, PDONative::FETCH_ASSOC); // Return arrays
$this->pdo->setAttribute(PDONative::ATTR_ERRMODE, PDONative::ERRMODE_EXCEPTION); // Handle all errors with exceptions
return $this->pdo;
}
}