Completed
Push — master ( 54e54a...70f940 )
by Mr
02:22
created

SQLException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 3
1
<?php
2
3
namespace DrMVC\Database;
4
5
/**
6
 * Class SQLException
7
 * @package DrMVC\Database
8
 */
9
class SQLException extends \PDOException
10
{
11
    public function __construct(string $message = '', int $code = 0, \Throwable $previous = null)
12
    {
13
        parent::__construct($message, $code, $previous);
14
15
        error_log(
16
            'Uncaught Error: ' . $this->getMessage() . ' in ' . $this->getFile() . ':' . $this->getLine() . "\n"
17
            . "Stack trace:\n" . $this->getTraceAsString() . "\n"
18
            . '  thrown in ' . $this->getFile() . ' on line ' . $this->getLine()
19
        );
20
    }
21
}
22