diff --git a/dibi/drivers/DibiPdoDriver.php b/dibi/drivers/DibiPdoDriver.php index f37dd075..e0bc6d63 100644 --- a/dibi/drivers/DibiPdoDriver.php +++ b/dibi/drivers/DibiPdoDriver.php @@ -68,13 +68,12 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver, IDibiResultDriver $this->connection = new PDO($config['dsn'], $config['username'], $config['password'], $config['options']); } catch (PDOException $e) { + if ($e->getMessage() === 'could not find driver') { + throw new DibiNotSupportedException("PHP extension for PDO is not loaded."); + } throw new DibiDriverException($e->getMessage(), $e->getCode()); } - if (!$this->connection) { - throw new DibiDriverException('Connecting error.'); - } - $this->driverName = $this->connection->getAttribute(PDO::ATTR_DRIVER_NAME); }