1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace AbterPhp\Admin\Exception; |
||
6 | |||
7 | use RuntimeException; |
||
8 | use Throwable; |
||
9 | |||
10 | class Database extends RuntimeException |
||
11 | { |
||
12 | /** |
||
13 | * Database constructor. |
||
14 | * |
||
15 | * @param array $errorInfo |
||
16 | * @param Throwable|null $previous |
||
17 | */ |
||
18 | public function __construct( |
||
19 | array $errorInfo = [], |
||
20 | Throwable $previous = null |
||
21 | ) { |
||
22 | $message = $errorInfo[2] ?? print_r($errorInfo, true); |
||
23 | $code = $errorInfo[1] ?? 0; |
||
24 | |||
25 | parent::__construct($message, $code, $previous); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
26 | } |
||
27 | } |
||
28 |