Skip to content

Commit e6eadca

Browse files
committed
DriverException: mimics original file&line of PDOException
1 parent 4f25cc1 commit e6eadca

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Database/DriverException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class DriverException extends \PDOException
2525
public static function from(\PDOException $src)
2626
{
2727
$e = new static($src->message, 0, $src);
28+
$e->file = $src->file;
29+
$e->line = $src->line;
2830
if (!$src->errorInfo && preg_match('#SQLSTATE\[(.*?)\] \[(.*?)\] (.*)#A', $src->message, $m)) {
2931
$m[2] = (int) $m[2];
3032
$e->errorInfo = array_slice($m, 1);

0 commit comments

Comments
 (0)