Commit 8d70cc73 authored by Filip Procházka's avatar Filip Procházka

Original PDOException is preserved and wrapped by Doctrine\DBAL\Driver\PDOException

parent 3c3a4b14
......@@ -49,7 +49,7 @@ class PDOException extends \PDOException implements DriverException
*/
public function __construct(\PDOException $exception)
{
parent::__construct($exception->getMessage(), 0, $exception->getPrevious());
parent::__construct($exception->getMessage(), 0, $exception);
$this->code = $exception->getCode();
$this->errorInfo = $exception->errorInfo;
......
......@@ -63,4 +63,9 @@ class PDOExceptionTest extends DbalTestCase
{
$this->assertSame(self::SQLSTATE, $this->exception->getSQLState());
}
public function testOriginalExceptionIsInChain()
{
$this->assertSame($this->wrappedExceptionMock, $this->exception->getPrevious());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment